To avoid any future problems with 64 bit architecture is recommended using Get-ObjectID-x86-x64 to determine ObjectID
;;------------------------------------------------ --------
;; function gets a string representation of ObjectID
;, regardless of AutoCAD x86 or x64
;; Source: "Field and objectid problem"
;; http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Field-and-objectid-problem/m-p/2478592/highlight/true#M276818
;; http://forum.dwg.ru/showthread.php?t=51822
;;------------------------------------------------ --------
(defun Get-ObjectID-x86-x64 (obj / util)
(setq util (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))))
(if (= (type obj) 'ENAME) (setq obj (vlax-ename-> vla-object obj)))
(if (= (type obj) 'VLA-OBJECT)
(if (> (vl-string-search "x64" (getvar "platform")) 0)
(vlax-invoke-method util "GetObjectIdString" obj: vlax-False)
(rtos (vla-get-objectid obj) 2 0)
)
)
)