Save Method (ActiveX)

Saves a document or group of layer property settings; no longer supported for menu groups.

Supported platforms: Windows only

Signature - Document

VBA:

object.Save
object

Type: Document

The object this method applies to.

Signature - LayerStateManager

VBA:

object.Save Name, Mask
object

Type: LayerStateManager

The object this method applies to.

Name

Access: Input-only

Type: String

The name to be assigned to the saved layer settings.

Mask

Access: Input-only

Type: AcLayerStateMask enum

A number representing the layer properties to be saved and restored. Use the following constants to identify layer properties:

  • acLsAll: All layer properties
  • acLsColor: Color
  • acLsFrozen: Frozen or thawed
  • acLsLineType: Linetype
  • acLsLineWeight: Lineweight
  • acLsLocked: Locked or unlocked
  • acLsNewViewport: New viewport layers frozen or thawed
  • acLsNone: None
  • acLsOn: On or off
  • acLsPlot: Plotting on or off
  • acLsPlotStyle: Plot style

Signature - MenuGroup

VBA:

object.Save MenuFileType
object

Type: MenuGroup

The object this method applies to.

MenuFileType

Access: Input-only

Type: AcMenuFileType enum

  • acMenuFileCompiled
  • acMenuFileSource

Return Value (RetVal)

No return value.

Remarks

Document: When you save a document to a secure URL, a dialog box prompts the user for the necessary password information.

Menugroup: This method has no effect for menu groups in AutoCAD 2006 or later. This method will be removed from the MenuGroup object in a future release.

Examples

VBA:

Sub Example_Save()
    ' The following example saves current drawing
    
    ThisDrawing.Save
    
End Sub

Sub Example_Save_LayerSettings()
    ' The following code saves the color and linetype settings
    ' of the current layer.

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.19")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database
    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

End Sub

Visual LISP:

(defun c:Example_Save()
    ;; The following example saves current drawing
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (vla-Save doc)
)

(defun c:Example_Save_LayerSettings()
    ;; The following code saves the color and linetype settings
    ;; of the current layer.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Access the LayerStateManager object
    (setq oLSM (vla-GetInterfaceObject acadObj "AutoCAD.AcadLayerStateManager.19"))

    ;; Associate the current drawing database with LayerStateManager
    (vla-SetDatabase oLSM (vla-get-Database doc))

    (vla-Save oLSM "ColorLinetype" (+ acLsColor acLsLineType))
)