-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Have tried varying the approach this 'Simple SolidWorks VBA Macro To Set Z-Up View Orientation' every which way I know how, but nothing seems to work and no one on the forums seems to have any idea why except one user who believes the command is 'not enabled'.
"The swCommands_ZUpViewOrientation command doesn't appear to be enabled. A call to SldWorks::IsCommandEnabled returns false."
Should be very EASY to do!
Perhaps a better question is, how to enable it?
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swExt As SldWorks.ModelDocExtension
Dim boolstatus As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swExt = swModel.Extension
swExt.RunCommand swCommands_ViewOrientation, Empty 'doesn't matter
swExt.RunCommand swCommands_ZUpViewOrientation, Empty 'not working
swApp.RunCommand swCommands_ZUpViewOrientation, Empty 'not working
End Sub