你这样写line和arc就是and的关系,CAD里面没有图元即是line也是arc的,所以你选不到,可以按2楼说的,也可以这样写,把关系写出来 Sub aa() On Error GoTo errcontrol '创建选择集 Set FilterSet = ThisDrawing.SelectionSets.Add("xxx") Dim FilterType(0 To 3) As Integer Dim FilterData(0 To 3) As Variant '设置过滤器类型 FilterType(0) = -4 FilterType(1) = 0 FilterType(2) = 0 FilterType(3) = -4 '设置过滤数据 FilterData(0) = "<or" FilterData(1) = "arc" FilterData(2) = "line" FilterData(3) = "or>" '使用过滤器,由用户在屏幕上选择 FilterSet.SelectOnScreen FilterType, FilterData
errcontrol: ThisDrawing.SelectionSets("xxx").Delete
End Sub |