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