Background:- My company has this slightly annoying but perfectly reasonable standard of saving model in a particular view, with all the view types hidden and a number of other things. Its times consuming so I started to create a macro, which I thought would be a simple task since i've made much more complex ones before.
The Problem:- I have to turn off all the View Type not just Hide All Types (they get stroppy if you do that). When I started on the macro I noticed something strange, there doesn't appear to be a display option for the highlighted view types in the following image...
This is the code so far...
01) Dim swApp As Object
02) Dim Part As Object
03) Dim boolstatus As Boolean
04) Dim longstatus As Long, longwarnings As Long
05) Sub main()
06) Set swApp = Application.SldWorks
07) Set Part = swApp.ActiveDoc
08) Dim myModelView As Object
09) Set myModelView = Part.ActiveView
10) myModelView.FrameState = swWindowState_e.swWindowMaximized
11) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLights, False)
12) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCameras, False)
13) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints, False)
14) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayReferencePoints2, False)
15) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swShowDimensionNames, False)
16) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAllAnnotations, False)
17) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplaySketches, False)
18) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCurves, False)
19) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayCoordSystems, False)
20) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayOrigins, False)
21) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayTemporaryAxes, False)
22) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayAxes, False)
23) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayLiveSections, False)
24) boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swDisplayPlanes, False)
25) End Sub
Has anyone come across with this before? Any ideas? Is the way of turning these final four off different than the others?
SolidworksApi macros