在 WCS 坐标中指定布局或打印配置的原点。 支持的平台:仅窗口 属性值只读:不 类型:变体(双精度的双元素数组) 表示相对于介质左下角的原点的X和Y值。 言论原点与介质边缘偏移纸张边距。使用该方法查询边距。原点以毫米为单位。GetPaperMargins 在重新生成图形之前,对此属性的更改将不可见。使用该方法再生图形。Regen 例子工 务 局: 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))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:47
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.