復元する画層のプロパティを指定します。
サポートされているプラットフォーム: Windows 版 AutoCAD のみ、Windows 版 AutoCAD LT ではサポートされていません
読み込み専用: いいえ
タイプ: AcLayerStateMask 列挙型
復元する画層プロパティを表す数値。画層プロパティを特定するために次の表の定数を使います。
LayerStateManager オブジェクトの Restore メソッドは、どの画層のプロパティを復元するかを指定するために、Mask プロパティを使います。LayerStateManager の Save メソッドを使って画層設定を保存するときは、Mask プロパティを先に設定します。しかし、Save メソッドは実際にはそれぞれの画層のすべてのプロパティを保存します。画層設定を復元する直前に、Mask プロパティを更新すると、復元される画層設定を変更できます。
Mask を使って複数の画層プロパティを指定するには、それらのプロパティを表す定数値を加算してください。たとえば、色と線種プロパティを保存するには、次のように指定ます。
acLsColor + acLsLineType
VBA:
Sub Example_SetMask()
' The following code updates the Mask property of layer
' settings saved under the name "ColorLineType, so that
' Color, LineType, and LineWeight layer properties will
' be restored by a Restore operation.
Dim oLSM As AcadLayerStateManager
Dim settings As AcLayerStateMask
Set oLSM = ThisDrawing.Application. _
GetInterfaceObject("AutoCAD.AcadLayerStateManager." & Left(AcadApplication.Version, 2))
oLSM.SetDatabase ThisDrawing.Database
oLSM.Save "ColorLinetype", acLsColor + acLsLineType
' Retrieve the current mask setting from ColorLinetype
settings = oLSM.Mask("ColorLinetype")
' Set mask so that Color, LineType, and LineWeight
' properties will be restored by a Restore operation
settings = acLsColor + acLsLineType + acLsLineWeight
' Commit the new settings mask to ColorLinetype
oLSM.Mask("ColorLinetype") = settings
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Mask()
;; The following code updates the Mask property of layer
;; settings saved under the name "ColorLineType, so that
;; Color, LineType, and LineWeight layer properties will
;; be restored by a Restore operation.
(setq acadObj (vlax-get-acad-object)
doc (vla-get-ActiveDocument acadObj))
(setq oLSM (vla-GetInterfaceObject acadObj (strcat "AutoCAD.AcadLayerStateManager." (substr (getvar "ACADVER") 1 2))))
(vla-SetDatabase oLSM (vla-get-Database doc))
(vla-Save oLSM "ColorLinetype" (+ acLsColor acLsLineType))
;; Retrieve the current mask setting from ColorLinetype
(setq settings (vla-get-Mask oLSM "ColorLinetype"))
;; Set mask so that Color, LineType, and LineWeight
;; properties will be restored by a Restore operation
(setq settings (+ acLsColor acLsLineType acLsLineWeight))
;; Commit the new settings mask to ColorLinetype
(vla-put-Mask oLSM "ColorLinetype" settings)
)