« Are You a Block, an Xref, or a Layout | Main | Command Database Updated for AutoCAD 2013 »


Jason Day

Nice code Lee. I have a quick question: how do you create a new page setup and copy the current layout settings to it? This code that I am using isn't working:

(setq INP "NewPageSetupName"
ADOC (vla-get-activedocument (vlax-get-acad-object))
ALAY (vla-get-ActiveLayout ADOC)
PLT_CFGS (vla-get-plotconfigurations ADOC)
(vlax-for X PLT_CFGS
(if (= (strcase (vla-get-name X)) (strcase INP))
(vla-delete X)
) )
(if (= (getvar "CTAB") "Model")
(setq SPACE :vlax-true LAY (vla-get-Layout (vla-get-ModelSpace ADOC)))
(setq SPACE :vlax-false LAY ALAY)
(setq PC (vla-add PLT_CFGS INP SPACE))
(vla-CopyFrom PC LAY)
(vla-put-name PC INP)

The comments to this entry are closed.