通过以下语句,可以获得AcDbRotatedDimension实体名,ID号等数据
Dim xx As AcadEntity For Each xx In ThisDrawing.ModelSpace Debug.Print xx.ObjectName Next
可以得到 多义线实体AcDbPolyline和尺寸线实体AcDbRotatedDimension ''
通过以下语句可得到一个矩形多义线的顶点坐标
Dim i, n As Integer 'Dim newObjs As AcadPolyline Dim newObjs As AcadLWPolyline
Dim retCoord As Variant Dim points(500) As Double n = ThisDrawing.ModelSpace.Count Debug.Print n Dim iii As Integer For i = 0 To n - 1 Debug.Print If ThisDrawing.ModelSpace.Item(i).ObjectName = "AcDbPolyline" Then Set newObjs = ThisDrawing.ModelSpace.Item(i) retCoord = newObjs.Coordinates mynpoint = (UBound(retCoord) + 1) / 2 Debug.Print mynpoint, "fdsafdsafdsa" For iii = 0 To mynpoint * 2 - 1 Debug.Print ThisDrawing.ModelSpace.Item(i).ObjectID & " point(" & iii & ") = " & retCoord(iii) Next iii '....... End If Next i 结果是
2130183496 point(0) = .231424421804538 2130183496 point(1) = 7.30334885445212 2130183496 point(2) = 12.245379023135 2130183496 point(3) = 7.30334885445212 2130183496 point(4) = 12.245379023135 2130183496 point(5) = -3.22310514584269 2130183496 point(6) = .231424421804538 2130183496 point(7) = -3.22310514584269
问:如何获得尺寸线实体数据,与绘图原状相同.
|