"Update Standard Views" in VBA

Hi,

Is there any way to apply this functionality in a VBA macro?

This updates all the default views based on the current view and selection. Recording a macro does not pick this action up.

Many thanks.

SolidworksApi macros
Answers 4
KR
KR 2012-08-01 Best Answer

Chris,

Typically if you can't record a simple command like this with a macro then you will want to look in ISldWorks::RunCommand.  Try this out:

Dim swApp As SldWorks.SldWorks

Sub main()

    Set swApp = Application.SldWorks

    swApp.RunCommand swCommands_Update_Std_View, "test"

End Sub

Hope this helps.

Keith

Video Tutorials for the SolidWorks API

SF
SF 2012-08-07

Hi Keith,

Thanks again for your continued help! This time, however, things were a little bit cryptic. I tried that code but couldn't see how it worked. Google didn't turn up any examples using swCommands_Update_Std_View, and other examples of swApp.RunCommand didn't help much either.

So I've just signed up for your "Video Tutorials for the SolidWorks API" course. I've watched some of the free content and am looking forward to getting up to speed on the more advanced stuff.

Thanks again,

Chris

SP
SP 2012-11-16

Did you ever find out how to do this?  I'm needing the same funtionality and just can't figure it out.

MK
MK 2012-11-16

This is not yet implemented in the API. There is an open enhancement SPR 539534 "Would like an API for the "Update Standard Views" command in the Orientation page". If you have a service subscription, please email apisupport@solidworks.com and asked to be attached to that SPR to give it more visibility.