'通过ThisDrawing.Utility.GetEntity返回多义线上个点的坐标,该多义线由用户选 Dim oEnt As AcadEntity ThisDrawing.Utility.GetEntity oEnt, pt, "Select a polyline" If TypeOf oEnt Is AcadLWPolyline Then get2Dpts = oEnt.Coordinates endif '通过选择集方法,选中若干多义线对象,遍历返回每一个多义线对象的个点坐标时,返回个点的坐标都不正确。选择集中对象的数量也不正确。不知道如何解决,请大侠指教。
Dim oEnt As Object Dim get2Dpts As Variant On Error Resume Next If Not IsNull(ThisDrawing.SelectionSets.Item("SS2")) Then Set sstext = ThisDrawing.SelectionSets.Item("SS2") CreateSelectionSet.Delete End If Set sstext = ThisDrawing.SelectionSets.Add("SS2") 'FilterType(0) = 0 'FilterData(0) = "LWpolyline" 'sstext.SelectOnScreen FilterType, FilterData sstext.SelectOnScreen For Each oEnt In sstext If (TypeOf oEnt Is AcadLWPolyline) Then get2Dpts = oEnt.Coordinates next |