IntelliCAD 11.1 Object Library | |
AddItems Method | |
See Also |
- Entities
- A selection set object to which the items are to be added.
- DeleteOriginals
Boolean value:
TRUE = Objects will be deleted.
FALSE = Objects will not be deleted.
Block Collection : AddItems Method |
Description
Syntax
Visual Basic |
---|
Public Sub AddItems( _ ByVal Entities As SelectionSet, _ Optional ByVal DeleteOriginals As Boolean = True _ ) |
Parameters
- Entities
- A selection set object to which the items are to be added.
- DeleteOriginals
Boolean value:
TRUE = Objects will be deleted.
FALSE = Objects will not be deleted.
Example
Private Sub AddItems_Example()
' This example creates a selection set, and a line and circle objects.
' It then adds the objects to the selection set and clears the set.
Dim ssetObj As IntelliCAD.SelectionSet
Dim I As Integer
Dim lineObj As IntelliCAD.Line
Dim startPoint As IntelliCAD.Point
Dim endPoint As IntelliCAD.Point
Dim circObj As IntelliCAD.Circle
Dim centerPt As IntelliCAD.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(0 To ThisDocument.ModelSpace.Count - 1) As IntelliCAD.Entity
For I = 0 To ThisDocument.ModelSpace.Count - 1
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.Clear
MsgBox "No. of items in sel. set (after clearing) = " & ssetObj.Count
End Sub