AttachedDrawing.SaveObjectsByLayer method

AutoCAD Map 3D ActiveX

AttachedDrawing.SaveObjectsByLayer method

Saves objects to drawing layers that match layers in an active drawing.

SaveObjectsByLayer( ) As Boolean

Returns True on success.

Note Because this method saves only to memory and not to disk, use the AttachedDrawing.Save method afterward to make the changes persistent.

Dim amobj as AcadMap

Dim pobj As AutoCADMap.Project

Dim dsobj as DrawingSet

Dim adobj as AttachedDrawing

Dim retval as Boolean

Set amobj = acadApp.GetInterfaceObject("AutoCADMap.Application")

Set pobj = amobj.Projects(ThisDrawing)

Set dsobj = pobj.DrawingSet

Set adobj = dsobj.Item(5)

retval = adobj.SaveObjectsByLayer

If retval = True Then

 MsgBox "Saved the objects that matched the layers."

Else

 MsgBox "Did not save the objects that matched the layers."

End If