Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Entname to ObjID Conversion

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
CNinBC
198 Views, 2 Replies

Entname to ObjID Conversion

I am writing a lisp program to create a multi-leader with a field linked to a CAD point position Z value, from the code attached below I can convert the entname of the selected point to an ObjID, however this ObjID does not match with the ID if I create the field by selecting the object manually. By looking at the difference of the IDs, first came to my mind was Hexadecimal to Decimal format different, but after the conversion, they are still not the same, why?

 

Thanks.

 

ObjID by lisp (see source code https://help.autodesk.com/view/OARX/2024/ITA/?guid=GUID-F0AE18DE-4E8F-48C6-8138-0AF7ECE14C49 )

 

Command: (setq ename-point (car (entsel "\nPick a Point:")))

Pick a Point:<Entity name: 2c997267d80>

Command: (setq vlaobject-point (vlax-ename->vla-object ename-point))
#<VLA-OBJECT IAcadPoint 000002c99d74b2c8>

 

Attached below is the ObjID if I insert the field by selecting the same object manually

 

%<\AcObjProp Object(%<\_ObjId 3064847564160>%).Coordinates \f "%lu6%pt4">%

 

 

Hexadecimal 000002c99d74b2c8 ===> Decimal 3064953352904

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: CNinBC

The ObjId in the field is the ObjectARX ObjectId, not the COM id. Use this to get the ObjectId:

https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-608ABDA5-D489-4DC8-B13E-643AA782B696

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
CNinBC
in reply to: Jeff_M

Thanks @Jeff_M for the advice, I found the solution https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/64-bit-object-id-problem/td-p/252705... 

 

(itoa (vla-get-ObjectId (VLAX-ENAME->VLA-OBJECT (CAR (ENTSEL)))))

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report