Plottable プロパティ(ActiveX)

画層が印刷可能かどうかを指定します。

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

構文と要素

VBA:

object.Plottable
object

タイプ: Layer

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

プロパティの値

読み込み専用: いいえ

タイプ: ブール型

注意

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

VBA:

Sub Example_Plottable()
    ' This example creates a new layer called "New_Layer".  It then uses
    ' the Plottable property of each Layer to display whether or not that layer
    ' is plottable.  The user has the ability to toggle the plottable state
    ' for each layer, and the final plottable status for all layers is displayed.
    
    Dim layerObj As AcadLayer, tempLayer As AcadLayer
    Dim msg As String

    ' Add the layer to the layers collection
    Set layerObj = ThisDrawing.Layers.Add("New_Layer")
    
    ' Make the new layer the active layer for the drawing
    ThisDrawing.ActiveLayer = layerObj
    
    ' Cycle through the layers and allow user to make them plottable or not
    
    For Each tempLayer In ThisDrawing.Layers
        If tempLayer.Plottable Then     ' Determine if this layer is plottable
            If MsgBox("The layer '" & tempLayer.name & "' will plot.  Would you like to turn off plotting for this layer?", vbYesNo & vbQuestion) = vbYes Then
                tempLayer.Plottable = False     ' Change plottable state
            End If
        Else
            If MsgBox("The layer '" & tempLayer.name & "' will not plot.  Would you like to turn on plotting for this layer?", vbYesNo & vbQuestion) = vbYes Then
                tempLayer.Plottable = True      ' Change plottable state
            End If
        End If
    Next
    
    ' Display the new plottable status of the layers in this drawing
    
    For Each tempLayer In ThisDrawing.Layers
        ' Determine if this layer is plottable
        If tempLayer.Plottable Then
            msg = msg & "The layer '" & tempLayer.name & "' will plot." & vbCrLf
        Else
            msg = msg & "The layer '" & tempLayer.name & "' will not plot." & vbCrLf
        End If
    Next

    MsgBox msg
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Plottable()
    ;; This example creates a new layer called "New_Layer".  It then uses
    ;; the Plottable property of each Layer to display whether or not that layer
    ;; is plottable.  The user has the ability to toggle the plottable state
    ;; for each layer, and the final plottable status for all layers is displayed.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Add the layer to the layers collection
    (setq layerObj (vla-Add (vla-get-Layers doc) "New_Layer"))
    
    ;; Make the new layer the active layer for the drawing
    (vla-put-ActiveLayer doc layerObj)
    
    ;; Cycle through the layers and allow user to make them plottable or not
    (vlax-for tempLayer (vla-get-Layers doc)
        (if (= (vla-get-Plottable tempLayer) :vlax-true)     ;; Determine if this layer is plottable
            (progn
                (alert (strcat "The layer '" (vla-get-Name tempLayer) "' set to plot."))
                (vla-put-Plottable tempLayer :vlax-false)     ;; Change plottable state
                (alert (strcat "The layer '" (vla-get-Name tempLayer) "' now set not to plot."))
            )
            (progn
                (alert (strcat "The layer '" (vla-get-Name tempLayer) "' set not to plot."))
                (vla-put-Plottable tempLayer :vlax-true)     ;; Change plottable state
                (alert (strcat "The layer '" (vla-get-Name tempLayer) "' now set to plot."))
            )
        )
    )

    (setq msg "")
  
    ;; Display the new plottable status of the layers in this drawing
    (vlax-for tempLayer (vla-get-Layers doc)
        ;; Determine if this layer is plottable
        (if (= (vla-get-Plottable tempLayer) :vlax-true)
            (setq msg (strcat msg "The layer '" (vla-get-Name tempLayer) "' will plot.\n"))
            (setq msg (strcat msg "The layer '" (vla-get-Name tempLayer) "' will not plot.\n"))
        )
    )

    (alert msg)
)