CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 2523 

CAD tip CAD tip # 11017:

Question CAD 
 %  platform  category 
Q - question

How to select a DWG object by its internal ID, its "handle"?

A - answer Each drawing object in a DWG file can be identified by its unique ID, a hexadecimal code which does not change through the DWG editing history. Any object (entity) is unambiguously identified by this hexadecimal number code.

If you need to find or select an object by this code, e.g. coming from an error message, you can use the LISP function (handent).

Then you can e.g. delete the complaining object with the command:

(entdel(handent "36A41"))
typed on the command line (replace the sample code 36A41 with your specific hexadecimal handle - the index, listed in the AutoCAD warning message).

To temporarily highlight the object before deleting, you can also use:

(redraw(handent "36A41")3)

To zoom to a specific object - if it is a visible drawing geometry object, use:

_ZOOM _O (handent "36A41") [Enter] [Enter]


(command "_ZOOM" "_O" (handent "36A41") "")

100% *  CAD 
26.7.2016    3352×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 12024:How to create a custom iProperty or Parameter with iLogic?
Tip 11751:toMulti converts polylines to multi-lines driven by a definition table.
Tip 11289:Adding, multiplying and rounding numbers inside DWG drawing texts - NumInText.
Tip 11288:Selection cycling is not working in TRIM/EXTEND.
Tip 11198:Justified attribute text in mirrored blocks (AutoCAD)

Back   All CAD Tips All CAD tips&tricks

How to map properties from an imported STEP file to Inventor? « | » How to copy Revit custom colors to another PC?

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.