本帖最后由 guohq 于 2011-6-14 23:43 编辑
- Public Function GetVerPts(ByVal objPolyLine3D As Polyline3d) As List(Of Point3d)
- Dim rtn As New List(Of Point3d)
- Using Trans As Transaction = DB.TransactionManager.StartTransaction
- Dim obj As Polyline3d = Trans.GetObject(objPolyLine3D.ObjectId, OpenMode.ForWrite)
- Dim Temp_Type As Poly3dType = obj.PolyType '将先前的拟合类型先保存下来,计算完毕后复原
- obj.ConvertToPolyType(Poly3dType.SimplePoly)
- Dim Vtx As PolylineVertex3d = Nothing
- For Each VID As ObjectId In obj
- Vtx = VID.GetObject(OpenMode.ForRead)
- rtn.Add(New Point3d(Vtx.Position.X, Vtx.Position.Y, Vtx.Position.Z))
- Next
- obj.ConvertToPolyType(Temp_Type)
- Trans.Commit()
- End Using
- GetVerPts = rtn
- End Function
说明:1.当polyline3d处于非拟合状态时可以计算其顶点坐标
2. DB = HostApplicationServices.WorkingDatabase |