Print Page | Close Window

lisp

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=5605
Printed Date: 19.Apr.2026 at 12:41


Topic: lisp
Posted By: vasuchowdary200
Subject: lisp
Date Posted: 29.Mar.2011 at 14:37
actually i have parcelnumbers in sequential like 1 to 999
 
how can i find the missing number from that
 
is ther any lisp for that



Replies:
Posted By: Vladimir Michl
Date Posted: 29.Mar.2011 at 15:00
I am not aware of any. But you can export the texts (or attributes) to a text file, sort it, and find any gaps.

-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: alanjt
Date Posted: 29.Mar.2011 at 22:43
A quick and dirty sub, but this will return any missing values in a list of numbers with a specified increment.

(defun foo (numberlist inc / low high i lst)
  (setq low  (apply 'min numberlist)
        i    low
        high (apply 'max numberlist)
  )
  (foreach x (cdr (vl-sort numberlist '<))
    (if (/= x (setq i (+ inc i)))
      (setq lst (cons i lst)
            i   (+ inc i)
      )
    )
  )
  (reverse lst)
)


eg.
(foo '(1 3 5 6 7 5 8 9) 1) -> (2 4)


Posted By: Vladimir Michl
Date Posted: 05.Apr.2011 at 10:42
You can use the SRXMISSING command from our updated srxText utility. See Download.

-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner



Print Page | Close Window