AnsweredAssumed Answered

Simple Macros stopped working

Question asked by S. Casale on Feb 8, 2017
Latest reply on Feb 8, 2017 by S. Casale

I created 2 simple macros that worked yesterday and do not today. I didn't write it, I use the record function with mouse clicks.

 

The files were saved and checked in to the vault.

 

It's so simple it's ridiculous that it doesn't work today.

 

Parts and assemblies, one macro hides all types and shifts to ISO view. one second shows all. Selections were done through the View drop down. Now

Both cases the debugger highlights:

 

____

 

 

Show:

Dim swApp As Object

 

 

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

 

Sub main()

 

 

Set swApp = Application.SldWorks

 

 

Set Part = swApp.ActiveDoc

Dim RouteMgr As Object

Set RouteMgr = Part.GetRouteManager()

boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewDisplayHideAllTypes, False)

 

 

' Named View

Part.ShowNamedView2 "*Isometric", 7

Part.ViewZoomtofit2

End Sub

 

_____

 

 

Hide:

Dim swApp As Object

 

 

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

 

Sub main()

 

 

Set swApp = Application.SldWorks

 

 

Set Part = swApp.ActiveDoc

Dim RouteMgr As Object

Set RouteMgr = Part.GetRouteManager()

boolstatus = Part.SetUserPreferenceToggle(swUserPreferenceToggle_e.swViewDisplayHideAllTypes, True)

 

 

' Named View

Part.ShowNamedView2 "*Isometric", 7

Part.ViewZoomtofit2

End Sub

 

SW2017 / PDM SP1

Outcomes