如何实现复合选择(如选择图层为"zd",红色的多段线)
<P>如何实现复合选择(如选择图层为"zd",红色的多段线)</P><P>cad的帮助写的太简略了</P>
<P>ssObj.select语句,它的过滤条件不知道怎么写</P>
<P>请高手相助,我想应该能够一次选中吧?</P> <P>Sub Example_Select()</P>
<P> Dim ssetObj As AcadSelectionSet<BR> On Error Resume Next<BR> Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")<BR> If Err <> 0 Then<BR> Set ssetObj = ThisDrawing.SelectionSets.Item("SSET")<BR> ssetObj.Clear<BR> End If<BR> <BR> Dim mode As Integer<BR> Dim obj As AcadEntity<BR> <BR> mode = acSelectionSetAll</P>
<P> Dim gpCode(2) As Integer<BR> Dim dataValue(2) As Variant<BR> gpCode(0) = 0<BR> dataValue(0) = "LWPOLYLINE"<BR> gpCode(1) = 8<BR> dataValue(1) = "zd"<BR> gpCode(2) = 62<BR> dataValue(2) = 1<BR> <BR> Dim groupCode As Variant, dataCode As Variant<BR> groupCode = gpCode<BR> dataCode = dataValue<BR> <BR> ssetObj.Select mode, , , groupCode, dataCode<BR> MsgBox "图中有" & ssetObj.Count & "个图元已加入到选择集SSET中。"<BR> For Each obj In ssetObj<BR> obj.Highlight True<BR> Next<BR> <BR>End Sub</P> 3ku vermuch
页:
[1]