Layers プロパティ(ActiveX)

ドキュメントの Layers コレクションを取得します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.Layers
object

タイプ: DatabaseDocument

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: はい

タイプ: Layers

ドキュメントの画層コレクション

注意

追加の注意はありません。

VBA:

Sub Example_Layers()
    ' This example finds the current Layers collection and
    ' adds a new layer to that collection.
    
    Dim layerColl As AcadLayers
    Set layerColl = ThisDrawing.Layers
    
    ' Create a dimension style named "TEST" in current drawing
    Dim testlayer As AcadLayer
    Set testlayer = layerColl.Add("TEST")
    MsgBox "A new layer called " & testlayer.name & " has been added to the Layers collection.", vbInformation, "Layers Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Layers()
    ;; This example finds the current Layers collection and
    ;; adds a new layer to that collection.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    (setq layerColl (vla-get-Layers doc))
    
    ;; Create a dimension style named "TEST" in current drawing
    (setq testlayer (vla-Add layerColl "TEST"))
    (alert (strcat "A new layer called " (vla-get-Name testlayer) " has been added to the Layers collection."))
)