Automate layouts in a2k2

Automate layouts in a2k2

Anonymous
Not applicable
232 Views
1 Reply
Message 1 of 2

Automate layouts in a2k2

Anonymous
Not applicable
I have a template file for drawings that contain all the stuff I typically
need, and my pspace layout contains only a titleblock with attributes, one
being "drawing number", and a viewport and a few exteraneous symbols that I
use. A typical job can contain anywhere from 50 to 100 drawings.

To create a new pspace layout here's what I do:
Rt.click on layout tab (named 01), create a copy, move to end, rt.clk/rename
to 02, switch to layout 02, attedit, select titleblock, rename drawing from
01 to 02. This is getting to be a real pain in the butt.

What I'd like is to have a custom button that will automate this process by
taking the currently selected layout and copying it by n+1, linking the
titleblock attribute to it. Also, being able to add a drawing like "4a"
between 4 and 5 would be a big help too. I'm no LISP or VBA ace, but would
really like to learn.
Can anyone help me out?
0 Likes
233 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
This automates the layout>>>copy command

Private Sub CommandButton1_Click()
'before sending command make form nonmodal, by using next 'commandbutton2 first.
ThisDrawing.SendCommand "layout" & vbCr & "c" & vbCr & "layout1" & vbCr & "Layout2" & vbCr
End Sub

Private Sub CommandButton2_Click()
'makeform nonmodal, so autocad can recieve commands
'while form is visible
UserForm1.Hide
UserForm1.Show False
End Sub

or make the previous routine a function in Module 1
how to:
autocad command VBAIDE
menu: Insert>>>Module
paste this function
Public Function makeNewLayout()
ThisDrawing.SendCommand "layout" & vbCr & "c" & vbCr & "layout1" & vbCr & "Layout2" & vbCr
End Function
run it from macros
or F5 while in modules code view.
0 Likes