Create new button to insert new layout from template

Create new button to insert new layout from template

ncoulton
Explorer Explorer
1,510 Views
3 Replies
Message 1 of 4

Create new button to insert new layout from template

ncoulton
Explorer
Explorer

I'm trying to add new command buttons to the Ribbon that will allow the user to insert a new layout based on a template. For example, if they click an 'A0_Land' button it will insert a new layout called 'A0SHEET' from a template called 'A0_Land.dwt'.

 

If I use the macro '^C^R_layout;T;A0_Land.dwt;' I get a small dialog box up that lists the available layouts in the A0_Land.dwt template (of which there is just the one called 'A0SHEET'.

 

Is there a way of bypassing the small dialog box and just specifying in the code the name of the layout? e.g. '^C^R_layout;T;A0_Land.dwt;A0SHEET;'

 

Even with FILEDIA set to 0 the dialog box still appears.

0 Likes
Accepted solutions (1)
1,511 Views
3 Replies
Replies (3)
Message 2 of 4

pendean
Community Legend
Community Legend
Any reason you don't want to use -PSETUPIN command? Requires a little more setup in your template files first. Put a dash in front of it in our macro to get the commandline version. Give it a try.
Message 3 of 4

ncoulton
Explorer
Explorer

Can't say I've ever used -PSETUPIN but am always up for trying something new. I'll have a read up and give it a go. Thanks.

 

-Update-

 

I've discovered that our main template file already has named page setups set for each layout (A0, A1 Land, A1 Port etc.) and these all show up in the Page Setup Manager when in the template file. However, when I use -PSETUPIN, specify the template file and enter '?' to list the available named page setups I get 'User defined page setup(s) in drawing:' but with no setups listed. If I type in a named page setup that I know exists in the template file I just get 'The specified page setup(s) were not found in <template file>. Any ideas?

Message 4 of 4

ncoulton
Explorer
Explorer
Accepted solution

I managed to sort the macro in the end (I tried -psetupin but couldn't get it to do what I wanted):

 

^C^Cfiledia 0 -layout t COMPANY_Title_Blocks.dwt A0LAND filedia 1 -layout s A0LAND -layout r A0LAND

 

The above script pulls in the 'A0LAND' tab (including the A0 title block on that tab) from COMPANY_Title_Blocks.dwt template. I've now created a command for each paper size and orientation and added them to a new tab on the ribbon. Job done.

0 Likes