Sub RemoveItems(Entities)
Removes one or more entities from the SelectionSet.
Syntax
object.RemoveItems(Entities)
Where:
object is a Block or SelectionSet object;
Entities is a selection set object to which the items are to be added.
RemoveItems method example
Private Sub RemoveItemsExample()
' This example creates a selection set, and a line and circle objects.
' It then adds the objects to the selection set and removes them.
Dim ssetObj As CADopia.SelectionSet
Dim I As Integer
Dim lineObj As CADopia.Line
Dim startPoint As CADopia.Point
Dim endPoint As CADopia.Point
Dim circObj As CADopia.Circle
Dim centerPt As CADopia.Point
Dim radius As Double
Dim ssetName
ssetName = InputBox("Type a name for the selection set:")
Set ssetObj = ThisDocument.SelectionSets.Add(ssetName)
' Create a line object in model space
Set startPoint = Library.CreatePoint(3, 1, 0)
Set endPoint = Library.CreatePoint(5, 5, 0)
Set lineObj = ThisDocument.ModelSpace.AddLine(startPoint, endPoint)
' Create a circle object in model space
Set centerPt = Library.CreatePoint(3, 1, 0)
radius = 5
Set circObj = ThisDocument.ModelSpace.AddCircle(centerPt, radius)
' Collect the objects into an array of objects
' to be added to the selection set.
ReDim ssobjs(1 To ThisDocument.ModelSpace.Count) As CADopia.Entity
For I = 1 To ThisDocument.ModelSpace.Count
Set ssobjs(I) = ThisDocument.ModelSpace.Item(I)
Next I
' Add the array of objects to the selection set
ssetObj.AddItems ssobjs
MsgBox "No. of items in sel. set = " & ssetObj.Count
ssetObj.RemoveItems ssobjs
End Sub
Recent Comments