AutoCAD データベースを LayerStateManager オブジェクトと関連付けます。
サポートされているプラットフォーム: Windows のみ
VBA:
object.SetDatabase Database
タイプ: LayerStateManager
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: Database
LayerStateManager オブジェクトに関連付けられる Database オブジェクト。
戻り値はありません。
追加の注意はありません。
VBA:
Sub Example_SetDatabase()
' The following code saves the color and linetype settings
' of the current layer. It uses the SetDatabase method to
' associate the current drawing database with the
' LayerStateManager object.
Dim oLSM As AcadLayerStateManager
' Access the LayerStateManager object
Set oLSM = ThisDrawing.Application. _
GetInterfaceObject("AutoCAD.AcadLayerStateManager." & Left(AcadApplication.Version, 2))
' Associate the current drawing database with LayerStateManager
oLSM.SetDatabase ThisDrawing.Database
oLSM.Save "ColorLinetype", acLsColor + acLsLineType
End Sub
Visual LISP:
(defun c:Example_SetDatabase()
;; The following code saves the color and linetype settings
;; of the current layer. It uses the SetDatabase method to
;; associate the current drawing database with the
;; LayerStateManager object.
(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))))
;; Associate the current drawing database with LayerStateManager
(vla-SetDatabase oLSM (vla-get-Database doc))
(vla-Save oLSM "ColorLinetype" (+ acLsColor acLsLineType))
)