如何使用选择集过滤器来得到多段线?(已解决)
本帖最后由 作者 于 2008-5-23 8:20:35 编辑 <br /><br /> <p>段下面的方法不行,请高手指教:</p><p> pType(0) = 0: pData(0) = "Polyline": pType(1) = 8: pData(1) = "*"<br/> plinex.Select acSelectionSetCrossing, dx1, dx2, pType, pData '多线选择集</p><p>或者<br/> plinex.Select acSelectionSetAll , , , pType, pData '多线选择集</p><p>也不行</p><p>但如果把"Polyline",修改为"line"就可以选中line线,不知是为什么?</p> <p>Dim FilterType(0) As Integer<br/>Dim FilterData(0) As Variant<br/>FilterType(0) = 0 <br/>FilterData(0) = "*POLYLINE" <br/>sset.SelectOnScreen FilterType, FilterData</p> <p>谢谢,这次选择是选择了,但又有新问题了,当遍历选择集的时候,提示类型不匹配。</p><p>不知为什么?难道多线类型不是AcadPolyline吗?请指点!!!</p><p>Dim fType(0 To 1) As Integer<br/>Dim fData(0 To 1) As Variant<br/>fType(0) = 0: fData(0) = "*Polyline": fType(1) = 8: fData(1) = "*"<br/>Dim adSS As AcadSelectionSet '选择集<br/>Dim pline As AcadPolyline<br/>Set adSS = ThisDrawing.SelectionSets.Add("adSS")<br/>adSS.Select acSelectionSetAll, , , fType, fData '按过滤条件选择<br/>MsgBox adSS.count<br/>For Each pline In adSS<br/> pline.Color = acRed<br/>Next<br/>adSS.Delete</p><p></p> <p>你选到的有LWPOLYLINE,也有POLYLINE<br/>如果你不需要两种一起选,那么可以把"*Polyline"改成对应类型<br/>如果你需要两种一起选,可以把Dim pline As AcadPolyline改成Dim pline As AcadObject<br/></p> <p>终于知道原因了,谢谢!</p> (setq ss(ssget '((0 . "lwpolyline")(0 ."polyline"))));ss中就只有多段线喽 对不起:应为(ssget '((0 ."LWPOLYLINE,POLYLINE"))))
页:
[1]