@leonucadomi Maybe This? Not able to test it without a drawing. Use command SETCURPSETUP to change the Page Setup of the current layout.
You can also remove the (if (= lay (getvar "ctab")) and the end parenthesis, leaving just (putpagesetup lay "IMPRIMIR EN A3") to apply to all layouts.
; 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 c:SetCurPsetup (/ lay)
(foreach lay (layoutlist)
(if (= lay (getvar "ctab"))(putPagesetup lay "IMPRIMIR EN A3"))
)
(princ)
)
There is also this:
http://www.theswamp.org/index.php?topic=38005.msg430212#msg430212