;;;从AutoCAD 2013 Active Reference帮助中code Examples中提取 ;;;本源代码由 xshrimp 2013.2.20 搜集整理,版权归原作者所有! (vl-load-com) (defun c:Example_PlotRotation() ;; This example reads and modifies the PlotRotation ;; 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 (vla-get-PlotRotation ACADLayout)) (alert (strcat "The PlotRotation value is set to: " (itoa originalValue))) ;; Modify the PlotRotation preference by toggling the value (vla-put-PlotRotation ACADLayout ac180degrees) (alert (strcat "The PlotRotation preference has been set to: " (itoa (vla-get-PlotRotation ACADLayout)))) ;; Reset the preference back to its original value (vla-put-PlotRotation ACADLayout originalValue) (alert (strcat "The PlotRotation preference was reset back to: " (itoa originalValue))) )