' ******************************************************************************
' SolidWorks graphics benchmark
' v1.00
'
' Tests rotation & zoom speed of your current model.
' ******************************************************************************
Dim swApp As Object
Dim swModel As Object
Dim swModelView As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Dim runTimeRotate As String
Dim runTimeZoom As String
Dim i As Double
Dim s As Double
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelView = swModel.ActiveView
Set SelMgr = swModel.SelectionManager
' Rotating performance
swModel.ShowNamedView2 "*Isometric", -1
swModel.ViewZoomtofit2
nStart = Timer
For i = 0 To 1000
swModel.ActiveView().RotateAboutCenter -3.14159265358979E-03, 0
swModel.ActiveView().RotateAboutCenter 0, -3.14159265358979E-03
Next i
runTimeRotate = Timer - nStart & " seconds"
' Zooming performance
swModel.ShowNamedView2 "*Isometric", -1
swModel.ViewZoomtofit2
s = swModelView.Scale2
nStart = Timer
For i = 1 To 1001
s = s * 1.005
swModelView.Scale2 = s
swModel.GraphicsRedraw2
' swModel.ViewZoomTo2 -6.39704, 0.902824, 2.96739, -0.347961, -3.72995, 2.96739
' swModel.ViewZoomtofit2
Next i
runTimeZoom = Timer - nStart & " seconds"
' Set the properties
propRet = swModel.AddCustomInfo3("", "benchmarkRotate", swCustomInfoText, runTimeRotate)
propRet = swModel.AddCustomInfo3("", "benchmarkZoom", swCustomInfoText, runTimeZoom)
' Return to isometric position
' swModel.ShowNamedView2 "*Isometric", -1
' swModel.ViewZoomtofit2
End Sub