Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding a layout tab per template with VBA

Status
Not open for further replies.

jrice174

Civil/Environmental
Nov 8, 2004
129
I'm trying to add a layout tab to a drawing from a template.
I've already got it to create the drawing from a template
as shown below, but how do I add more layout tabs with the same template?

Here is what I have to create the drawing from the template

ThisDrawing.SetVariable "SDI", 1 'Single Document Interface or MDI
Dim templateFileName As String
templateFileName = "K:\CAD\CAD Features\Templates\TB-STANDARD.dwt"
ThisDrawing.New templateFileName
ThisDrawing.SetVariable "SDI", 0
Pt1(0) = 0: Pt1(1) = 0
ThisDrawing.ActiveLayout = ThisDrawing.Layouts("STANDARD TITLEBLOCK")

and I know that I can add a layout using

Set objLayout = ThisDrawing.Layouts.Add(LayoutName)

I just can't quite get the whole thing together to add the layout with the template.

Any help would be appreciated. THANKS
 
Replies continue below

Recommended for you

From the top toolbar choose "INSERT"<
From the pulldown, choose "LAYOUT"<
From the flyout, choose "NEW LAYOUT"<.

I pulled a torpedo level out of the bag and put it on the frame rail and the senior year intern engineering student exclaimed "Ooo...what is that?!".
 
Also, from the command line, type "LAYOUT"<
At the command line, type "N"<
Then type the name for the new layout.

I pulled a torpedo level out of the bag and put it on the frame rail and the senior year intern engineering student exclaimed "Ooo...what is that?!".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor