SaveSet.RemoveObjects method

AutoCAD Map 3D ActiveX

SaveSet.RemoveObjects method

Removes an object from a save set.

RemoveObjects(ToBeRemoved As Variant) As Long

Returns the number of objects removed from the save set.

ToBeRemoved

An array of Longs containing the IDs of objects in the save set.

You can specify the IDs of locked, erased, or newly created objects.

The following example builds on the SaveSet.Add example. For more information, click .

You call the following procedure from the SaveSet.Add example to remove three objects from the save set.

Sub removeobjects(lngIDArray As Variant)

 

Dim amap As AcadMap

Dim prj As Project

Dim i As Integer

Dim varArray As Variant

Dim strOutput As String

Dim lngIDArray2() As Long

ReDim lngIDArray2(3)

 

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set prj = amap.Projects(ThisDrawing)

lngIDArray2(0) = lngIDArray(1)

lngIDArray2(1) = lngIDArray(5)

lngIDArray2(3) = lngIDArray(8)

prj.SaveSet.removeobjects lngIDArray2

varArray = prj.SaveSet.GetObjects(kQueriedExisted)

Debug.Print "Three objects removed from save set"

If UBound(varArray) > -1 Then

For i = 0 To UBound(varArray) 

Debug.Print varArray(i) 

Next i 

End If

 

End Sub