AutoCAD Architecture Customization

AutoCAD Architecture Customization

Reply
Valued Mentor
mdhutchinson
Posts: 2,321
Registered: ‎11-18-2003
Message 1 of 4 (147 Views)

Extract Vertices from AecPolyGon?

147 Views, 3 Replies
06-28-2012 03:30 AM

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.

Valued Mentor
mdhutchinson
Posts: 2,321
Registered: ‎11-18-2003
Message 2 of 4 (146 Views)

Re: Extract Vertices from AecPolyGon?

06-28-2012 05:33 AM 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
)

Valued Mentor
mdhutchinson
Posts: 2,321
Registered: ‎11-18-2003
Message 3 of 4 (145 Views)

Re: Extract Vertices from AecPolyGon?

06-28-2012 05:42 AM 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?

*Expert Elite*
David_W._Koch
Posts: 2,729
Registered: ‎12-09-2003
Message 4 of 4 (140 Views)

Re: Extract Vertices from AecPolyGon?

06-28-2012 07:25 PM 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.