VBA中,如何可以创建多个选择集
如题,目前看例子只会创建1个,多个就不太清楚怎么创建了static/image/hrline/4.gif
Public Sub CreateSelectionSet(SeleObjts As AcadSelectionSet, Name As String)
On Error Resume Next
If Not IsNull(ThisDrawing.SelectionSets.Item(Name)) Then
Set SeleObjts = ThisDrawing.SelectionSets.Item(Name)
SeleObjts.Delete
End If
Set SeleObjts = ThisDrawing.SelectionSets.Add(Name)
End Sub
static/image/hrline/4.gif
Dim SeleObjts_1 As AcadSelectionSet
Call CreateSelectionSet(SeleObjts_1, "SeleObjts_1"): SeleObjts.SelectOnScreen
Dim SeleObjts_2 As AcadSelectionSet
Call CreateSelectionSet(SeleObjts_2, "SeleObjts_2"): SeleObjts.SelectOnScreen
Dim SeleObjts_2 As AcadSelectionSet
Call CreateSelectionSet(SeleObjts_3, "SeleObjts_3"): SeleObjts.SelectOnScreen
--- 这样可以么 ???
不能太多最多256个 本帖最后由 wuyunpeng888 于 2024-5-5 15:08 编辑
用SelectionSets集合对象的add方法创建命名选择集,在图形中最多可创建 128 个命名选择集
页:
[1]