yulijin608 发表于 2004-10-13 14:10:00

有关选择集

我想选取固定层上的对象,可是老是提示说select 作用于对象IAcadSelectionSet时失败,为什么?哪为大侠帮帮忙,先谢了.
Sub selection()
                                Dim a As AcadSelectionSet
                       For i = 0 To ThisDrawing.SelectionSets.Count - 1
                                                       If (ThisDrawing.SelectionSets.Item(i).name = "给水") Then
                                                                                                                       ThisDrawing.SelectionSets.Item(i).Delete
                                                                                                                       Exit For
                                                       End If
                       Next i
                       
                       Set a = ThisDrawing.SelectionSets.Add("给水")
                       a.Select acSelectionSetAll, , , 8, "给水"
End Sub

zfbj 发表于 2004-10-13 14:18:00

在本论坛搜索“安全创建选择集”,已多次讨论过。

yulijin608 发表于 2004-10-13 14:22:00

多谢版主

wyj7485 发表于 2004-10-13 14:22:00

Sub selection()
                       Dim a As AcadSelectionSet
                       Dim FilterType(0) As Integer
                       Dim FilterData(0) As Variant
                       
                       FilterType(0) = 8
                       FilterData(0) = "给水"
                       
                       Set a = ThisDrawing.SelectionSets.Add("给水")
                       
                       a.Select acSelectionSetAll, , , FilterType, FilterData
                       a.Delete
End Sub
页: [1]
查看完整版本: 有关选择集