You are on page 1of 2

(defun putPagesetup (document layout setup) (if (vl-catch-all-error-p (vl-catch-all-apply (function (lambda () (vla-copyfrom (vla-item (vla-get-layouts document) layout)

(vla-item (vla-get-plotconfigurations document) setup) ))))) nil t );end if );end defun

(defun C:IMP_PAGESETUP ( / LAYS LAYOUTLIST1 CURTAB PCFGS) (vl-load-com) (setq LAYS (vlax-get-property (vlax-get-property (vlax-Get-Acad-object) 'ActiveDocument) 'Layouts)) (setq LAYOUTLIST1 '()) (vlax-for LAY LAYS (setq LAYOUTLIST1 (append LAYOUTLIST1 (list (vla-get-name LAY))))) (if (member "model" LAYOUTLIST1) (progn (setq CURTAB (getvar "ctab")) (setvar "ctab" "Model") (command "-psetupin" "acadp.dwt" "hp 4050 portrait monochrome") (setq document (vla-get-activedocument (vlax-get-acad-object))) (setq PCFGS (vla-get-plotconfigurations document))

(putpagesetup document "Model" "hp 4050 portrait monochrome") (setvar "ctab" CURTAB);<-- Remove if you want to leave it on Layout1 );end progn (princ "\nModel not found!") );end if );end defun

You might also like