Extracting coordinates from a LW Pline & a 2D Pline

Extracting coordinates from a LW Pline & a 2D Pline

Anonymous
Not applicable
215 Views
2 Replies
Message 1 of 3

Extracting coordinates from a LW Pline & a 2D Pline

Anonymous
Not applicable
Hi,

I have the following code

Dim lineObj As AcadObject
Dim coord As Variant
ThisDrawing.Utility.GetEntity lineObj, basePnt, "Select Line"
MsgBox "One " & lineObj.EntityName & " selected"
coord = lineObj.Coordinate(1)
MsgBox "The coordinate in the first index position of the polyline is: "
& coord(0) & ", " _
& coord(1) & ", " & coord(2)

This works OK on a "AcDb2dPolyline" object (2D polyline) and a
"AcDb3dPolyline" object (3D polyline) but does not work when I select an
"AcDbPolyline" object (lightweight polyline).

How can I get the coordinates of a lightweight polyline and why does this
not work?.

Any assistance will be appreciated.

Regards

Sean Bartleet
0 Likes
216 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Sean Bartleet had this to say:

> How can I get the coordinates of a lightweight polyline and why does
> this not work?.

LWPolylines have 2D vertices not 3D, so only access coord(0) & coord(1).

--
"If you want to be somebody else change your mind"
http://www.acadx.com
http://vbxtender.sourceforge.net
0 Likes
Message 3 of 3

Anonymous
Not applicable
Duh!

Thank you very much for the help, I really appreciate it. Sometimes I wonder
what that stuff is swirling around in my head.

Ciao

Sean
0 Likes