How to get Polyline3D vertices coordinates?

How to get Polyline3D vertices coordinates?

bwang-tecoustics
Collaborator Collaborator
2,940 Views
1 Reply
Message 1 of 2

How to get Polyline3D vertices coordinates?

bwang-tecoustics
Collaborator
Collaborator

I see some C# codes and tried to converted to VB but not working. Can somebody help me on this or tell me how to get the coordinates of a 3D Polyline? Thx.

http://through-the-interface.typepad.com/through_the_interface/2007/04/iterating_throu.html

http://forums.autodesk.com/t5/net/how-to-iterate-through-polyline3d-vertices-with-quot-for-quot/m-p/...

 

 

If TypeOf entity Is Polyline3d Then
                            Dim tr As Transaction = db.TransactionManager.StartTransaction()
                            Using tr
                                Dim Poly3d As Polyline3d
                                Poly3d = TryCast(tr.GetObject(entity.ObjectId, OpenMode.ForRead), Polyline3d)
                                Dim pv3d As PolylineVertex3d
                                pv3d = DirectCast(tr.GetObject(Poly3d.ObjectId, OpenMode.ForRead), PolylineVertex3d)
                                ed.WriteMessage((ControlChars.Lf + pv3d.Position.ToString))
                                tr.Commit()
                            End Using
End If
0 Likes
2,941 Views
1 Reply
Reply (1)
Message 2 of 2

bwang-tecoustics
Collaborator
Collaborator
0 Likes