Hello :
Somebody can help me ? This problem trouble me all day long. I wanna transfer objectID form VLisp to .net. The following is my lisp code
(defun ZSW::VLA::enameObjID(name / vlaName vlaObjID)
(setq vlaName (vlax-ename->vla-object name))
(setq vlaObjID (vlax-get-property vlaName 'ObjectID))
vlaObjID
)
.....
(setq xdata (ZSW::VLA::enameObjID lname))
(WriteDetailInfo xdata "HG/T20615-2009" "法兰" "200-150 RF" "20II" "12.1" "12.1" "1")
.....
"WriteDetailInfo" defined in my .net <lispfunction"WriteDetailInfo"> _
But in fact this doesn't work. What I got in .net shows that xdata is lispdatatype.Int32 but lispdatatype.ObjectId
the question is how can I get correct objectID from lisp.
No need to pass handle strings here (that's actually far more
difficult to convert to an ObjectId in managed code).
You need to pass the LISP entity name, not the value returned
by the ActiveX/vla-Object's ObjectID property (which is a 32 bit integer).
If you have a vla-object, then you can use (vlax-vla-object->ename)
to get the value you need to pass.