hardwired 发表于 2008-3-10 10:10:38

我是这样做的。可能有更好和/或更优雅的方式…
On Error Resume Next
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.SelectionSets.Item("abcd")
If Err.Number0 Then
    Set ss = ThisDrawing.SelectionSets.Add("abcd")
    Err.Clear
Else
    ss.Clear
End If

rkmcswain 发表于 2008-3-10 11:02:47

我不记得我从哪里得到这个,它可能来自前一阵子与RR的其他网站......或者它可能在其他地方
Dim Mycollection As AcadSelectionSets
Dim SSet1 As AcadSelectionSet
' first check if any ss exist and if they do, delete them
      Set Mycollection = ThisDrawing.SelectionSets
             For Each SSet1 In Mycollection
               If SSet1.Name = "MySS" Then
                     ThisDrawing.SelectionSets.Item("MySS").Delete
                     Exit For
               End If
             Next
我通常将其放在我创建新选择集的部分之前
页: 1 [2]
查看完整版本: 检查块是否存在..