Preset and Reset Template and Sheet Parameters for New Drawing Documents
Example (VBA)
This example shows how to preset the template and sheet parameters for
a new drawing document so that the Sheet
Format/Size dialog is not displayed when opening a new drawing
document. This example also shows how to reset this behavior back to the
SolidWorks default.
'--------------------------------
'
' Preconditions: SolidWorks is open.
'
' Postconditions: The Sheet Format/Size dialog is not
shown
' when
a new drawing document is opened.
' After
the document has been opened, the behavior
' is
set back to its default.
'
'---------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Sub main()
Set swApp = Application.SldWorks
' Preset new drawing template and sheet parameters
swApp.PresetNewDrawingParameters
"C:\Program Files\SolidWorks\SolidWorks\data\a - portrait.slddrt",
True, 0, 0
Stop
' Interactively open a new drawing document; Sheet Format/Size
dialog is not displayed
' Reset the drawing template and sheet parameters
' Sheet Format/Size dialog will be displayed next
' time a new drawing document is opened
swApp.ResetPresetDrawingParameters
End Sub