Add Objects to a Selection Set

AutoCAD ActiveX

 
Add Objects to a Selection Set
 
 
 

You can add objects to the active selection set by using any of the following methods:

AddItems

Adds one or more objects to the specified selection set.

Select

Selects objects and places them into the active selection set. You can select all objects, objects within and crossing a rectangular area, objects within and crossing a polygon area, all objects crossing a fence, the most recently created object, the objects in the most recent selection set, objects within a window, or objects within a window polygon.

SelectAtPoint

Selects objects passing through a given point and places them into the active selection set.

SelectByPolygon

Selects objects within a fence and adds them to the active selection set.

SelectOnScreen

Prompts the user to pick objects from the screen and adds them into the active selection set.

Add selected objects to a selection set

This example prompts the user to select objects, then adds those objects to the selection set.

Sub Ch4_AddToASelectionSet()
    ' Create a new selection set
    Dim sset As AcadSelectionSet
    Set sset = ThisDrawing.SelectionSets.Add("SS1")
      
    ' Prompt the user to select objects
    ' and add them to the selection set.
    ' To finish selecting, press ENTER.
    sset.SelectOnScreen
      
End Sub