AutoCAD LISP 建立配置與設置配置相關設定
快速介紹: 1.刪除已有"Test"的配置 2.增加一個叫"Test"的配置 3.設置出圖型式表(圖筆指定) 4.設置繪圖機 5.設置紙張大小 6.指定為當前配置 7.返回當前的出圖型式表(圖筆指定)和繪圖機 程式碼: (defun c:addTheLayout ( / acadApp acadDoc layouts layoutObj currPStyle currConfig) (vl-load-com) (setq acadApp (vlax-get-Acad-object)) (setq acadDoc (vla-get-ActiveDocument acadApp)) (setq layouts (vla-get-Layouts acadDoc)) ;; Delete the layout named "Test" if it exists ;; 刪除已有"Test"的配置 (vlax-for objLayout layouts (if (= (vla-get-name objLayout) "Test") (progn (princ (strcat "\n 刪除已有配置 " (vla-get-name objLayout) " ..." ) ) (vla-delete objLayout) ;_刪除配置 (vlax-release-object objLayout) ;_ 釋放配置物件 ) ;_progn ) ;_if ) ;_vlax-for ;; 增加一個叫"Test"的配置 (setq layoutObj (vla-add layouts "Test")) ;; Assign Grayscale.CTB to the Layout ;; 給配置設置出圖型式表(圖筆指定) (vla-put-StyleSheet layoutObj &qu