Discussion:
Script to import page setup to multiple drawings.
(too old to reply)
Casey Roberts
2004-09-02 22:08:38 UTC
Permalink
Is there a way to run a script that will import a named page into multiple
drawings (using script pro)....

I can get a command line version of psetupin by changing filedia to 0
however, it still brings up a dialog box to select the page setup.

Any suggestions? or easier methods?

setting cmddia to 0 does not suppress the page setup dialog box either...
dangit.


Thanks,

Casey
David Harper
2004-09-03 04:02:30 UTC
Permalink
Casey


if you enter '-psetupin' at the command line all the input is done at the
command line.
We have pulldown menu's that doe this and then use the imported is then used
for plotting to a specific network printer

C^C-psetupin;"[Pagesetupfile.dwg]";[Pagesutup name];n;-plot;;;[Pagesutup
name];;;;;

The PagesetupFile .dwg can have more than 1 pagesetup.

Hope that helps
Post by Casey Roberts
Is there a way to run a script that will import a named page into multiple
drawings (using script pro)....
I can get a command line version of psetupin by changing filedia to 0
however, it still brings up a dialog box to select the page setup.
Any suggestions? or easier methods?
setting cmddia to 0 does not suppress the page setup dialog box either...
dangit.
Thanks,
Casey
Joe Burke
2004-09-05 13:56:03 UTC
Permalink
Casey,

This demo copies a named page setup from the active file to all other open files. It
could be modified to process files in a folder.

Joe Burke

;; JB 9/5/2004
;; copy a plot configuration (named page setup)
;; from the active file to other open files
;; if name exists in target file, it's skipped
(defun c:CopyPlotConfigs (/ *acad* documents doc cfgs name cnt
srccfg modtype doccfgs newcfg)
(and
(setq *acad* (vlax-get-acad-object))
(setq documents (vla-get-documents *acad*))
(setq doc (vla-get-ActiveDocument *acad*))
(setq cfgs (vla-get-PlotConfigurations doc))
(setq cnt 0)
(setq name (getstring T "\nEnter page setup name to copy: "))
(or
(setq srccfg (ValidItem cfgs name))
(prompt "\nPage setup name does not exist in the active file. ")
)
(setq modtype (vlax-get srccfg 'ModelType))
(vlax-for x documents
(setq doccfgs (vla-get-PlotConfigurations x))
(if (not (ValidItem doccfgs name))
(progn
(if (= -1 modtype)
(setq newcfg (vla-Add doccfgs name T)) ;model cfg
(setq newcfg (vla-Add doccfgs name)) ;layout cfg
)
(vlax-invoke newcfg 'CopyFrom srccfg)
(setq cnt (1+ cnt))
)
T
)
) ;for
(princ (strcat "\nNumber of files modified: " (itoa cnt)))
) ;and
(princ)
) ;end

;; check for item in collection
(defun ValidItem (collection item / res)
(vl-catch-all-apply
'(lambda ()
(setq res (vla-item collection item))))
res
) ;end
Post by Casey Roberts
Is there a way to run a script that will import a named page into multiple
drawings (using script pro)....
I can get a command line version of psetupin by changing filedia to 0
however, it still brings up a dialog box to select the page setup.
Any suggestions? or easier methods?
setting cmddia to 0 does not suppress the page setup dialog box either...
dangit.
Thanks,
Casey
Loading...