感谢超版 成功了 贴代码 封贴
- Function CreateSelectionSet(Optional SSetName As String = "mjtd") As AcadSelectionSet
- On Error Resume Next
- ThisDrawing.SelectionSets(SSetName).Delete
- Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(SSetName)
- End Function
-
-
- '================================================
- Sub tsts()
- Dim ss_ob As AcadSelectionSet
- Set ss_ob = CreateSelectionSet("ssss")
- Dim mode As Integer
- Dim corner1(0 To 2) As Double
- Dim corner2(0 To 2) As Double
-
- mode = acSelectionSetCrossing
- corner1(0) = 0: corner1(1) = 0: corner1(2) = 0
- corner2(0) = 9: corner2(1) = 1.72: corner2(2) = 0
-
- Dim gpCode(0 to 4) As Integer
- Dim dataValue(0 to 4) As Variant
-
- gpCode(0) = 0
- dataValue(0) = "TEXT"
-
-
- gpCode(1) = -4
- dataValue(1) = ">=,>=,*"
-
- gpCode(2) = 10
- dataValue(2) = corner1
-
- gpCode(3) = -4
- dataValue(3) = "<=,<=,*"
-
- gpCode(4) = 10
- dataValue(4) = corner2
-
-
- Dim groupCode As Variant, dataCode As Variant
- groupCode = gpCode
- dataCode = dataValue
-
- ss_ob.Select mode, corner1, corner2, groupCode, dataCode
- MsgBox ss_ob.Count
- 'ss_ob.Item(0).Delete
- ss_ob.delete
-
- End Sub
|