如何在AutoCAD中获取Polyline2d顶点数量
在AutoCAD中,Polyline2d对象没有NumberOfVertices属性。您可以使用GetNumberOfVertices方法来获取多段线的顶点数量。示例代码如下:\n\n\nDim polyline As Polyline2d = New Polyline2d()\n' 添加多段线的顶点\npolyline.AppendVertex(New Point2d(0, 0))\npolyline.AppendVertex(New Point2d(0, 1))\npolyline.AppendVertex(New Point2d(1, 1))\n' 获取多段线的顶点数量\nDim numberOfVertices As Integer = polyline.NumberOfVertices()\n\n\n请注意,Polyline2d的NumberOfVertices方法返回的是多段线的顶点数量,而不是属性。
原文地址: https://www.cveoy.top/t/topic/l1It 著作权归作者所有。请勿转载和采集!