PlotOrigin Property (ActiveX)

Specifies the origin of the layout or plot configuration in WCS coordinates.

Supported platforms: Windows only

Signature

VBA:

object.PlotOrigin
object

Type: Layout, PlotConfiguration

The objects this property applies to.

Property Value

Read-only: No

Type: Variant (two-element array of doubles)

The X and Y values representing the origin relative to the lower-left corner of the media.

Remarks

The origin is offset from the media edge by the paper margin. Use the GetPaperMargins method to query the margins. The origin is given in millimeters.

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.

Examples

VBA:

Sub Example_PlotOrigin()
    ' This example reads and modifies the PlotOrigin
    ' Layout value.
    ' When finished, this example resets the  value back to
    ' its original value.
    
    Dim ACADLayout As ACADLayout
    Dim originalValue As Variant
    Dim newValue(0 To 1) As Double
    
    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout
    
    ' Read and display the original value
    originalValue = ACADLayout.PlotOrigin
    MsgBox "The PlotOrigin value is set to: " & originalValue(0) & " ," & originalValue(1)

    ' Modify the PlotOrigin preference by toggling the value
    newValue(0) = originalValue(0) + 20
    newValue(1) = originalValue(1) - 20
    ACADLayout.PlotOrigin = newValue
    MsgBox "The PlotOrigin value is set to: " & newValue(0) & " ," & newValue(1)

    ' Reset the preference back to its original value
    ACADLayout.PlotOrigin = originalValue
    MsgBox "The PlotOrigin value is set to: " & originalValue(0) & " ," & originalValue(1)
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_PlotOrigin()
    ;; This example reads and modifies the PlotOrigin
    ;; Layout value.
    ;; When finished, this example resets the  value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Get the layout object
    (setq ACADLayout (vla-get-ActiveLayout doc))
    
    ;; Read and display the original value
    (setq originalValue (vlax-variant-value (vla-get-PlotOrigin ACADLayout)))
    (alert (strcat "The PlotOrigin value is set to: " (rtos (vlax-safearray-get-element originalValue 0) 2) " ,"
                                                      (rtos (vlax-safearray-get-element originalValue 1) 2)))

    ;; Modify the PlotOrigin preference by toggling the value
    (setq newValue (vlax-make-safearray vlax-vbDouble '(0 . 1)))
    (vlax-safearray-fill newValue (list (+ (vlax-safearray-get-element originalValue 0) 20)
                                        (- (vlax-safearray-get-element originalValue 1) 20)))
    (vla-put-PlotOrigin ACADLayout newValue)
    (alert (strcat "The PlotOrigin value is set to: " (rtos (vlax-safearray-get-element newValue 0) 2) " ,"
                                                      (rtos (vlax-safearray-get-element newValue 1) 2)))

    ;; Reset the preference back to its original value
    (vla-put-PlotOrigin ACADLayout originalValue)
    (alert (strcat "The PlotOrigin value is set to: " (rtos (vlax-safearray-get-element originalValue 0) 2) " ,"
                                                      (rtos (vlax-safearray-get-element originalValue 1) 2)))
)