功能 设置是否在布局中显示图纸空间背景。 语法及参数 | (vla-put-LayoutDisplayPaper Object Value) | | Object | MSITStore:C:/cbz242/VBA%20鍑芥暟璇存槑.chm::/PreferencesDisplay%20对象.htm">PreferencesDisplay | | | 这个属性适用的对象。 | | Value | 布尔;读/写 | | | :vlax-true : 在布局中显示图纸背景 :vlax-false : 不在布局中显示图纸背景 |
说明 这个属性的初始值是:vlax-true。
范例
(defun Example_LayoutDisplayPaper() ;;; 这个范例读取并显示修改用于控制 ;;; 布局中图纸背景显示的的系统配置值, ;;; 在完成后,这个范例将系统配置重设为原来的值 (VL-LOAD-COM) (setq AcadObject(vlax-get-acad-object)
AcadDocument(vla-get-ActiveDocument AcadObject)
mSpace(vla-get-ModelSpace AcadDocument) ) ;;;
取得显示系统配置对象 (setq preferenceSel(vla-get-Preferences AcadObject)) (setq AcadPref(vla-get-display preferenceSel)) ;;;
切换到图纸空间来观察发生的改变 (vla-put-ActiveSpace AcadDocument acPaperSpace) ;;;
读取并显示原始值 (setq originaValue(vla-get-LayoutDisplayPaper AcadPref)) (princ "LayoutDisplayPaper系统配置设定为: ")(princ originaValue)(princ " LayoutDisplayPaper范例\n") (PROMPT "<Enter>进行:")(VL-CMDF pause) ;;;
以切换值的方式修改LayoutDisplayPaper 系统配置 (vla-put-LayoutDisplayPaper AcadPref (ToF originaValue)) (setq newValue(vla-get-LayoutDisplayPaper AcadPref)) (vla-Regen AcadDocument acAllViewports) (princ "LayoutDisplayPaper系统配置已经设定为: ")(princ newValue)(princ " LayoutDisplayPaper范例\n") (PROMPT "<Enter>进行:")(VL-CMDF pause) ;;; 将系统配置设定重设为原来的值 ;;; * 注意:请将以下2行程序注释以使 ;;; 这个系统配置的改变产生作用;;; (vla-put-LayoutDisplayPaper AcadPref originaValue) (vla-Regen AcadDocument acAllViewports) (princ "LayoutDisplayPaper系统配置已经重设为: ")(princ originaValue)(princ " LayoutDisplayPaper范例\n") (princ) ) (defun ToF(msg) (if (= msg :vlax-true) (setq msg :vlax-false) (setq msg :vlax-true) ) ) caoyin版主:如何把上面这程序改成:“布局中不显示图纸空间背景”,不要进行切换的。 |