Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am working on a subroutine that inserts a titleblock and creates a template but I am having a problem with applying a page setup to the layout tab. How can I apply the pagesetup to the active document layout? Below is what i have gotten so far. When i run this nothing seems to happen when applying the pagesetup.
(defun tbandTemp (prjnum titlb projectlocation titleinfo pagesetup /) ;;; Set Titleblock Resource file (setq acadobj(vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadobj)) (setq newtemp (strcat projectlocation "\\" shtloc prjnum)) (setq titleblock (strcat projectlocation "\\" resloc prjnum "XRTB.dwg")) ; (alert titleblock) (setvar "cmdecho" 0) (setvar "filedia" 0) (vl-file-copy (strcat cadtb titlb) titleblock) (setvar "tilemode" 0) (if (gcs-Make-Layer "G-TITL-BLOK") (setvar "CLAYER" "G-TITL-BLOK") ) (command "-XREF" "Attach" titleblock "0,0" "1" "1" "0") (vlax-for pc (vla-get-plotconfigurations doc) (vla-delete pc)) (command "._-PSETUPIN" "C:\\_Genesis-CAD_\\Templates\\GEI-PAGE SETUPS.dwt" pagesetup) (SetNamePageSetup pagesetup) (if (gcs-Make-Layer "G-TITL-FLDS") (setvar "CLAYER" "G-TITL-FLDS") ) (vla-SaveAs doc newtemp ac2013_Template) (setvar "cmdecho" 1) (setvar "filedia" 1) ) (defun SetNamePageSetup (name / adoc alayt lst) (if (and (vl-position name (vlax-for pltcfg (vla-get-plotconfigurations (setq adoc (vla-get-activedocument (vlax-get-acad-object)))) (setq lst (cons (vlax-get pltcfg 'Name) lst)) ) ) (/= (vla-get-name (setq alayt (vla-get-activelayout adoc))) "Model") ) (vla-copyfrom alayt (vla-item (vla-get-PlotConfigurations adoc) name)) ) )
Solved! Go to Solution.