Message 1 of 3
Subtracting one selection set from another?

Not applicable
05-23-2000
02:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to delete everything in a drawing except for whatever is inside
of an area defined by a windowl, but run into the following problem:
' Create a new selection set with everything in it
Dim ssetObj As AcadSelectionSet
Set ssetObj = acadDoc.SelectionSets.Add("SSET")
Dim mode As Integer
mode = acSelectionSetAll
ssetObj.Select mode
' Create another selection set of the stuff that I want to keep
Dim ssetObjKeep As AcadSelectionSet
Set ssetObjKeep = acadDoc.SelectionSets.Add("KEEP")
mode = acSelectionSetCrossing
Dim corner1(0 To 2) As Double
Dim corner2(0 To 2) As Double
corner1(0) = 0.1938: corner1(1) = 0.21: corner1(2) = 0
corner2(0) = -0.1938: corner2(1) = -0.3025: corner2(2) = 0
ssetObjKeep.Select mode, corner1, corner2
' Subtract the "keeper" set from the main set
' The problem is with this next line. It says "invalid argument"
ssetObj.RemoveItems ssetObjKeep
' Delete everything in the main selection set
ssetObj.Erase
Is there an easier approach to this problem?
Thanks,
John S.
of an area defined by a windowl, but run into the following problem:
' Create a new selection set with everything in it
Dim ssetObj As AcadSelectionSet
Set ssetObj = acadDoc.SelectionSets.Add("SSET")
Dim mode As Integer
mode = acSelectionSetAll
ssetObj.Select mode
' Create another selection set of the stuff that I want to keep
Dim ssetObjKeep As AcadSelectionSet
Set ssetObjKeep = acadDoc.SelectionSets.Add("KEEP")
mode = acSelectionSetCrossing
Dim corner1(0 To 2) As Double
Dim corner2(0 To 2) As Double
corner1(0) = 0.1938: corner1(1) = 0.21: corner1(2) = 0
corner2(0) = -0.1938: corner2(1) = -0.3025: corner2(2) = 0
ssetObjKeep.Select mode, corner1, corner2
' Subtract the "keeper" set from the main set
' The problem is with this next line. It says "invalid argument"
ssetObj.RemoveItems ssetObjKeep
' Delete everything in the main selection set
ssetObj.Erase
Is there an easier approach to this problem?
Thanks,
John S.