Adds objects to the save set.
AddObjects(ToBeAdded As Variant) As Long
Returns the number of objects added.
ToBeAdded
You can add the IDs of locked, erased, or newly created objects.
The following example assumes you altered queried objects of a drawing before running this code. For sample code for querying a drawing and altering properties, For more information, click . This example adds queried objects to a save set and displays their IDs.
Dim amap As AcadMap
Dim prj As Project
Dim i As Integer
Dim entry As Object
Dim varArray As Variant
Dim lngIDArray() As Long
ReDim lngIDArray(ThisDrawing.ModelSpace.Count)
Dim strOutput As String
Set amap = ThisDrawing.Application. _
GetInterfaceObject("AutoCADMap.Application")
Set prj = amap.Projects(ThisDrawing)
For Each entry In ThisDrawing.ModelSpace
lngIDArray(i) = entry.ObjectID
i = i + 1
Next
prj.SaveSet.AddObjects lngIDArray
varArray = prj.SaveSet.GetObjects(kQueriedExisted)
Debug.Print "SaveSet objects--all queried objects"
If UBound(varArray) > -1 Then
For i = 0 To UBound(varArray)
Debug.Print varArray(i)
Next i
End If