« 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)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment

Comments are moderated, and will not appear until the author has approved them.

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

My Photo

My Other Accounts

LinkedIn Twitter

Twitter Updates

    follow me on Twitter