CenterPlot プロパティ(ActiveX)

用紙の中央に印刷するように指定します。

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

構文と要素

VBA:

object.CenterPlot
object

タイプ: LayoutPlotConfiguration

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

プロパティの値

読み込み専用: いいえ

タイプ: ブール型

注意

このプロパティに対する変更は図面が再作図されないと分かりません。Regen メソッドを使用して図面を再作図してください。

PlotType プロパティが acLayout に設定されたレイアウト オブジェクト上で、このプロパティを True に設定することはできません。

VBA:

Sub Example_CenterPlot()
    ' This example will access the Layouts collection for the current drawing
    ' and display whether the plot for this layout is to be centered on the media.
    ' It will then toggle the state of CenterPlot for "Layout1" and re-display the
    ' CenterPlot state for each Layout.

    Dim Layouts As AcadLayouts, Layout As ACADLayout
    Dim msg As String
    Dim IsCentered As String
    
    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts
    
    ' Display current layout information
    GoSub DISPLAY
    
    ' Toggle centered state for Layout1
    Layouts("Layout1").PlotType = acDisplay
    Layouts("Layout1").CenterPlot = Not (Layouts("Layout1").CenterPlot)
    ThisDrawing.Regen acAllViewports
    
    ' Display new layout information
    GoSub DISPLAY
    
    Exit Sub
    
DISPLAY:
    msg = ""    ' Clear message
    
    ' Determine whether this layout is centered on the media during a plot
    For Each Layout In Layouts
        IsCentered = IIf(Layout.CenterPlot, " are centered ", " are not centered ")
        
        ' Format for display
        msg = msg & "Objects for " & Layout.name & IsCentered & "on the media during a plot." & vbCrLf
    Next
    
    ' Display layout information
    MsgBox msg
    
    Return
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_CenterPlot()
    ;; This example will access the Layouts collection for the current drawing
    ;; and display whether the plot for this layout is to be centered on the media.
    ;; It will then toggle the state of CenterPlot for "Layout1" and re-display the
    ;; CenterPlot state for each Layout.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Get layouts collection from document object
    (setq Layouts (vla-get-Layouts doc))
    
    ;; Display current layout information
    (setq msg "")    ;; Clear message
    
    ;; Determine whether this layout is centered on the media during a plot
    (vlax-for Layout Layouts
        (setq IsCentered (if (= (vla-get-CenterPlot Layout) :vlax-true) " are centered " " are not centered "))
        
        ;; Format for display
        (setq msg (strcat msg "Objects for " (vla-get-Name Layout) IsCentered "on the media during a plot.\n"))
    )
    
    ;; Display layout information
    (alert msg)
  
    ;; Toggle centered state for Layout1
    (vla-put-PlotType (vla-Item Layouts "Layout1") acDisplay)
    (vla-put-CenterPlot (vla-Item Layouts "Layout1") (if (= (vla-get-CenterPlot (vla-Item Layouts "Layout1")) :vlax-true) :vlax-false :vlax-true))
    (vla-Regen doc acAllViewports)

    (setq msg "")    ;; Clear message
    ;; Display new layout information
    (vlax-for Layout Layouts
        (setq IsCentered (if (= (vla-get-CenterPlot Layout) :vlax-true) " are centered " " are not centered "))
        
        ;; Format for display
        (setq msg (strcat msg "Objects for " (vla-get-Name Layout) IsCentered "on the media during a plot.\n"))
    )
    
    ;; Display layout information
    (alert msg)
)