PDA

View Full Version : Function to select an ObjectId


clovis
2008-12-01, 06:07 PM
Hello,
I'd like to know if it's possible to select an object thanks to its property ObjectID
in the same way as it's possible to select one with (handent ...)
(func. ObjectId) where ObjectId is an interger
; ObjectID (RO) = 2121000296
If not, I'll make a (ssget..) and check all ObjectId property
Thanks

irneb
2008-12-01, 06:57 PM
It's definitely possible, only you have to do this using the VL ActiveX extensions. E.g:(setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) ;Get VLA object of current DWG
(setq obj (vla-ObjectIDToObject doc 1234567)) ;Get VLA object of entity with ID 1234567
(setq en (vlax-vla-object->ename obj)) ;Get the ename from that object
(setq ed (entget en)) ;Get the usual DXF data of that entity

clovis
2008-12-02, 09:12 AM
That's it!
Thanks a lot!!