Restore Method (ActiveX)

Restores a group of layer property settings.

Supported platforms: Windows only

Signature

VBA:

object.Restore Name
object

Type: LayerStateManager

The object this method applies to.

Name

Access: Input-only

Type: String

The name of the saved layer settings to be restored.

Return Value (RetVal)

No return value.

Remarks

The Restore method uses the Mask property associated with the saved settings to identify which layer properties are to be restored.

Examples

VBA:

Sub Example_RestoreLayerSettings()
    ' The following code restores color and linetype settings
    ' that were saved as "ColorLineType".
	
    Dim oLSM As AcadLayerStateManager
	
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager." & Left(AcadApplication.Version, 2))

    oLSM.SetDatabase ThisDrawing.Database
    oLSM.Restore "ColorLinetype"

End Sub

Visual LISP:

(defun c:Example_Restore()
    ;; The following code restores color and linetype settings
    ;; that were saved as "ColorLineType."
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Access the LayerStateManager object.
    (setq oLSM (vla-GetInterfaceObject acadObj (strcat "AutoCAD.AcadLayerStateManager." (substr (getvar "ACADVER") 1 2))))

    (vla-SetDatabase oLSM (vla-get-Database doc))
  
    (vla-Restore oLSM "ColorLinetype")
)