Skip to content

Simple SolidWorks VBA Macro To Set Z-Up View Orientation #164

@BWNicholsPE

Description

@BWNicholsPE

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions