TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: T.Willey on October 19, 2006, 01:56:38 PM
-
I mean how can one step through an AcDb2dPolyline to get the vertex objects? I know you can do it with enames and entnext, but is there way way with straight ActiveX controls? Question just popped into my head, and I didn't have/find an answer.
Thanks.
-
Mnimal / brute force / concept code --
(defun foo ( document 2dPlineObject / result )
(
(lambda ( objectID )
(while
(eq "AcDb2dVertex"
(vla-get-objectname
(setq object
(vla-objectidtoobject
document
objectID
)
)
)
)
(setq
result (cons object result)
objectID (+ 8 objectID)
)
)
)
(+ 8 (vla-get-objectID 2dPlineObject))
)
(reverse result)
)
:)
-
<not compatible with object dbx because of the vla-objectidtoobject call which works strictly in an active document context>
-
Is the the same way 'entnext' works? Finds the code (hex?) of the object, and then adds one (8 because of hex number system) number to it? Very interesting. I would never have thought of doing it this way.
-
Is the the same way 'entnext' works?
Kinda, insomuch as they are sequential entiies / objects.
Finds the code (hex?) of the object, and then adds one (8 because of hex number system) number to it?
No, nothing to do with hex. Just my observataion that ObjectIDs are issued as a multiple of 8.
Caution -- not tried against polylines with modified / deleted vertices -- driver beware.
:)
-
Thanks again Michael. I think this must be the only way. I was hoping there was something simple I missed, like (vlax-invoke BlkObj 'GetAttributes), but for polylines.
-
My pleasure. I think it more of a demonstration of the <cough> complete object model Autodesk authored.
:)