I made a simple macro which changes the drawing's sheet size.
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
SheetWidth = 0.297
SheetHeight = 0.21
Dim myForm As New sizeChanger
myForm.Caption = "Sheet SizeChanger"
myForm.Show
SheetWidth = myForm.Width
SheetHeight = myForm.Height
boolstatus = Part.SetupSheet5("Sheet1", 12, 13, 1, 1, True, "C:\Documents and Settings\All Users\Application Data\SolidWorks\SolidWorks 2009\a - landscape.slddrt", myForm.Width, myForm.Height, "Default", True)
Set myForm = Nothing
End Sub
//
Public Height As Double
Public Width As Double
Private Sub A4P_Click()
Width = 0.21
Height = 0.297
MsgBox "Your Sheet Is Now A4"
End Sub
Private Sub bA3_Click()
Width = 0.42
Height = 0.297
MsgBox "Your Sheet Is Now A3"
End Sub
Private Sub bA4_Click()
Width = 0.297
Height = 0.21
MsgBox "Your Sheet Is Now A4"
End Sub
Private Sub bFin_Click()
Hide
End Sub
//
It works fine but when I press 'finish' without choosing a sheet size or just close it, SW zooms out to about 1000m x 600m.
How can I fix this?
SolidworksApi macros