IntelliCAD 11.1 Object Library
Clear Method
See Also 
SelectionSet Collection : Clear Method

Description

Empties the selection set. The selection set will still exist, but will contain no items.

Syntax

Visual Basic
Public Sub Clear() 

Remarks

If you clear a selection set, it will still exist, but it will contain no items.

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

See Also

© 2022 IntelliCAD Technology Consortium. All Rights Reserved.