Hi,
The GetObjectIdString method returns a string and you use it with atoi which requires an integer: (atoi id)
By my side I use a function which return the objectId as string and works whatever the AutoCAD version (32 ou 64 bits):
(defun gc:GetObjectIdString (obj)
(or *util*
(setq *util* (vla-get-Utility (vla-get-ActiveDocument (vlax-get-acad-object))))
)
(if (vlax-method-applicable-p *util* 'GetObjectIdString)
(vla-GetObjectIdString *util* obj :vlax-false)
(itoa (vla-get-ObjectId obj))
)
)
Using example in a field code:
(strcat ("%<\\AcObjProp Object(%<\\_ObjId"
(gc:GetObjectIdString vla-obj)
">%).Area \\f \"%lu2\">%"
)
)