Find Handle id Autocad Drawings

What is handle id in Autocad drawings

handles are unique within a drawing   and create automatically to all objects (with no repeating id  ) You can use the  list  command line in autocad drawing or  select object you want to find handle id  then press F2 key  example like this

Find handle id  by Autolisp

A few months ago I received comments from the consultant concerning  to   the as built drawings related to G.I.S  (geographic information system) and Cad drawings  one of  those comment  to remove one point with specified handle number (handle id ) from AutoCad drawing which is containing  more than 2000 points and polyline which each object having unique handle id,  it took  a lot of time to find handle id for each  point which have requested handle number (handle id), after that I  found  this lisp to find out any object by handle number  (handle id) from drawing in less than a second. for more information about to find handle id  by handle id  see this video, it is  free autolisp you can download click  here , also you can see this code.

How it will work this lisp

  1. Upload the lisp of find handle id, see example.
  2. Type in command line zomh
  3. Hit enter key to zoom to the object which  related to specified handle id

Find handle id by command line

To select an entity based on its handle id

  1. On the command line type    _SELECT   then hit enter key
  2. Type (HANDENT “XXX”)  change the XXX with handle number you want to get then hit enter key

To zoom to an entity based on its handle id

    1. On the command line type    _ZOOM then select the object option
    2. When prompted to Select Objects, type  (HANDENT “XXX”) change the XXX with handle id you want to zoom  then hit enter key

list command

handle id autocad drawing
handle id autocad

lisp code

(defun c:zh ( / YourHandle ll ur )
(vl-load-com)
(setq YourHandle (getstring "\nEnter Handle: "))
(if (handent YourHandle)
(progn
(vla-getboundingbox (vlax-ename->vla-object (handent YourHandle)) 'll 'ur)
(vla-zoomwindow (vlax-get-acad-object) ll ur)
(sssetfirst nil (ssadd (handent YourHandle)))
)
(princ "\nHandle not in drawing")
)
(princ)
)

how to upload the lisp

Share This Post

Post Comment