This routing changes all tabs for printing to a specific printer. But now it does not work on Autocad Electric 2014.
Cn anyone help..
@Anonymous wrote:This routing changes all tabs for printing to a specific printer. But now it does not work on Autocad Electric 2014.
Cn anyone help..
Without seeing the code, is difficult to help...Post the code...
"it does not work"
Gives some error msg?
If so, what is the error msg?
Henrique
; Jason Piercey . May 16th, 2003
; assign a pagesetup to a layout
; [layout] - string, layout name
; [setup] - string, pagesetup to assign
; return: T or nil
(defun putPagesetup (layout setup / layouts plots)
(defun item-p (collection item)
(if
(not
(vl-catch-all-error-p
(vl-catch-all-apply
'(lambda () (setq item (vla-item collection item))))))
item
)
)
(and
(or *acad* (setq *acad* (vlax-get-acad-object)))
(or *doc* (setq *doc* (vla-get-activedocument *acad*)))
(setq layouts (vla-get-layouts *doc*))
(setq plots (vla-get-plotconfigurations *doc*))
(setq layout (item-p layouts layout))
(setq setup (item-p plots setup))
(not (vla-copyfrom layout setup))
)
)
(defun massoc (key alist / x nlist)
(foreach x alist
(if (eq key (car x))
(setq nlist (cons (cdr x) nlist))
)
)
(reverse nlist)
)
; Return: list of all pagesetups defined in the current drawing or nil
(defun getPagesetups ()
(massoc 3 (dictsearch (namedobjdict) "Acad_PlotSettings"))
)
; Jason Piercey . May 19th, 2003
; assign pagesetup to layout(s)
; LIMITED testing
; written for Shawn McDonald
(defun c:psetup (/ lst page res)
(setq lst (mapcar 'strcase (getPagesetups)))
(while (not page)
(setq page (strcase (getstring "\nspecify pagesetup to apply: ")))
(if (or (= "" page) (not (member page lst)))
(progn (princ "\npagesetup not found") (setq page nil))
)
)
(initget "All Current")
(if
(not
(setq
res
(getkword
"\n[All/Current]apply pagesestup to which layout(s) <all>: ")))
(setq res "All")
)
(if (= "All" res)
(foreach x (layoutlist) (putPagesetup x page))
(putPagesetup (getvar "ctab") page)
)
(princ "\nFinished")
(princ)
)
@Anonymous wrote:
heres the routing
?
No errors but it does not complete the routing and does not change the printer designation to a different one
?
Tested, and everything as it should...
In the tests I made, I didn't found errors when applying a page setup, to all layouts, ctb, plotter, paper, everything was correctly applied.
I can't replicate your error, maybe someone else can.
Henrique
@Anonymous wrote:Are you in R14 ??
Tested in 2014, and everything ok!
Note that was not tested in Autocad Electrical, maybe someone with Autocad Electrical 2014, can test the code...
Henrique