How do I add Objects to Selection sets with out selection. Meaning with out prompting Selecting command.
Thanks.
Printable View
How do I add Objects to Selection sets with out selection. Meaning with out prompting Selecting command.
Thanks.
You can't add entities to a selection set. You have to use one of the selection methods. However, the SelectAll method using a filter can probably get you close to what you need. You didn't specify any criteria for what kind of items you want to add.
Hi Ed, as matter of fact, objects can be added into AcadSelectionSet without calling SelectXXX() methods, or asking user to select on screen: AcadSelectionSet.AddItems([an array of AcadEntity]).
To the OP:
Here is simplified code sample:
Of course, objects can also be removed from selection set by calling AcadSelectionSet([array of AcadEntity])Code:Dim ss As ACadSelectionSet
Dim ent As AcadEntity
Dim ents() As AcadEntity
Dim i As Integer
Set ss=ThisDrawing.SelectionSets.Add("MySet")
For Each ent in ThisDrawingModelSpace
ReDim Preserve ents(i)
Set ents(i)=ent
i=i+1
Next
ss.AddItems ents
'' Do whatever with the selection set
ss.Delete
Thank you.