Jump to content

AutoCAD 2010 Handle "ID" number of an object


jgvanir

Recommended Posts

Hi all,

 

I am using AutoCAD 2010 and need to know if there is a way to export (to excel or any other way) all the Handle "Id" numbers (see attachment) of all objects in a drawing.

 

Or, Can I create a schedule in CAD with all the objects and their properties in a drawing and the export it to excel or other type of document?

 

 

Thanks to all.

CAD Handle number.jpg

Link to comment
Share on other sites

Well known author, columnist, instructor and programmer Bill Kramer outlined a Visual lisp routine that assembles an entity data list in his book The AutoCadet's Guide to Visual Lisp. It is depicted on page 177.

 

Google "lisp"+"autocad"+"handle" (exactly as you see it here).

Link to comment
Share on other sites

Just a quick one :P

 

(defun c:getHand (/ ss file)
 (vl-load-com)
 (if (and (setq ss (ssget))
          (setq file (getfiled "Output File" "" "txt;csv" 9)))
   (progn
     (setq file (open file "a"))
     (mapcar
       (function
         (lambda (x)
           (write-line
             (cdr (assoc 5 x)) file)))
       (mapcar 'entget
         (vl-remove-if 'listp
           (mapcar 'cadr (ssnamex ss)))))
     (close file))
   (princ "*Cancel*"))
 (princ))

Link to comment
Share on other sites

This is what I was referring to.

 

(DEFUN READ_DRAWING ( / EN)

(SETQ EN (ENTNEXT)) ;get first drawing database entry

(WHILE EN ;loop while EN has binding

; process entity name EN

(SETQ EN (ENTNEXT EN)) ;get the next database entry

) ;end WHILE loop

)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...