[求助] 请教高手,关于把全部多段线加入选择集
<p>把文件中的所有多段线都加入到选择集中。前面的语句是建立一个选择集,然后根下面的语句</p><p>fType(0) = 0: fDate(0) = "Polyline": fType(1) = 8: fDate(1) = "*"<br/> sset.Select acSelectionSetAll, , , fType, fDate</p><p>运行以后选择集里面没有加入任何对象。请问这是怎么回事?</p><p>我用sset.selectonscreen 就能把对象加入到选择集中</p><p></p> <p>Private Sub SelectLWPOLYLINE()<br/> Dim SSet As AcadSelectionSet<br/> Set SSet = CreateSelectionSet<br/> Dim fType(1) As Integer ' 过滤器规则<br/> Dim fData(1) As Variant ' 过滤器参数<br/> fType(0) = 0: fData(0) = "LWPOLYLINE": fType(1) = 8: fData(1) = "*"<br/> SSet.Select acSelectionSetAll, , , fType, fData<br/> MsgBox SSet.Count<br/>End Sub<br/>Public Function CreateSelectionSet(Optional ssName As String = "ss") As AcadSelectionSet<br/> '返回一个空白选择集<br/> <br/> Dim ss As AcadSelectionSet<br/> <br/> On Error Resume Next<br/> Set ss = ThisDrawing.SelectionSets(ssName)<br/> If Err Then Set ss = ThisDrawing.SelectionSets.Add(ssName)<br/> ss.Clear<br/> Set CreateSelectionSet = ss<br/>End Function<br/>建议将fDate改为fData。</p><p>Polyline是二维多段线,通常用pline画出来的是LWPOLYLINE即轻量多段线。</p>
页:
[1]