TheSwamp
Code Red => .NET => Topic started by: sybold on August 09, 2013, 09:56:36 AM
-
how do i get all the vertices from a polyfacemesh, is it even possible?
i found the method, GetEnumerator, but i'm not sure it will get me what i need.
this is what i was working with and doesn't work.
Dim Entity1 As PolyFaceMesh = DirectCast(tr.GetObject(id1, OpenMode.ForRead), PolyFaceMesh)
Dim pfmenum As IEnumerable(Of PolyFaceMeshVertex) = Entity1.GetEnumerator
For Each Pfmv As PolyFaceMeshVertex In pfmenum
originalpnts.Add(Pfmv.Position)
Next
-
Try this code:
For Each pt As Point3d In pfMesh'<-- Entity1
Dim mvex As New PolyFaceMeshVertex(pt)
ed.Writeline(vbLf & "{0:f3}", pt)
Next
-
got it done this way
Dim Entity1 As PolyFaceMesh = DirectCast(tr.GetObject(id1, OpenMode.ForRead), PolyFaceMesh)
Dim vertices As New Point3dCollection()
For Each id As ObjectId In Entity1
Dim obj As DBObject = tr.GetObject(id, OpenMode.ForRead)
If TypeOf obj Is PolyFaceMeshVertex Then
Dim vertex As PolyFaceMeshVertex = DirectCast(obj, PolyFaceMeshVertex)
vertices.Add(vertex.Position)
End If
Next