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

Extract Vertices from AecPolyGon?

3 REPLIES 3
Reply
Message 1 of 4
mdhutchinson
335 Views, 3 Replies

Extract Vertices from AecPolyGon?

I have lisp code to extract the vertices from a LWpolyline. Can someone point to me the way to do this with AecPolyGons?  I know that a couple releases ago... autodesk pulled most all of the top level group code data out of Aec and Mep objects... so that you need to use .NET or lisp ActiveX functions... but I can't seem to discover the collection of vertices.

3 REPLIES 3
Message 2 of 4
mdhutchinson
in reply to: mdhutchinson

I believe I've found the solution:

 

(defun AecPolyVerts (Ent /)
  (if (null lst2lists)(load "listfuns"))
  (setq VlaPoly (vlax-ename->vla-object Ent))
  (setq VLProfile (vlax-get-property VlaPoly "Profile"))
  (setq VLCoorinates (vlax-get-property VLProfile "Coordinates"))
  (setq Coords (vlax-safearray->list (vlax-variant-value VLCoorinates)))
  (setq Coords (lst2lists Coords 2))
  Coords
)

Message 3 of 4
mdhutchinson
in reply to: mdhutchinson

I spoke too soon. The vertices don't seem to update... they remain the same even when the object is moved. What am I missing?

Message 4 of 4
David_W_Koch
in reply to: mdhutchinson

This is just a guess, but from what you describe, it sounds like the vertices are stored using an "entity" coordinate system. So somewhere in the data tot the AEC Polygon, there is an insertion point or origin point, in World Coordinates, and then the vertices are stored relative to that origin point. That way, when the object is moved, only the origin point needs to be updated.

David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

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

Post to forums  

”Boost