API Call for Explode Status?

Sep 07, 2007 2 Replies

Hi all,



I am trying to write a tiny macro to toggle the explode state of the current configuration in my assemblies. I don't like having to go thru config tab of the feature manager every time.


From what I can tell I need two macros to do this because there does

not seem to be a way to determine if the current config is already exploded or not. I am using AssemblyDoc::ShowExploded to set the state either True or False, but to create a toggle I need to know the current state. Does anyone know if there is such a flag that can be read via a macro?


Much appreciated.


Dave



Thanks, That worked great! If anyone is interested, here is the code I ended with.

' ****************************************************************************** ' Toggle Explode of Current Configuration ' ****************************************************************************** Dim swApp As SldWorks.SldWorks Dim Model As SldWorks.AssemblyDoc Dim CurrentSetting As Boolean

Sub main()

Set swApp = Application.SldWorks Set Model = swApp.ActiveDoc

If Model.IsExploded() Then CurrentSetting = Model.ShowExploded(False) ' Un-Explode it Else CurrentSetting = Model.ShowExploded(True) 'Explode it End If

End Sub

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required