API Call for Explode Status?

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

Reply to
david
Loading thread data ...

retval = ModelDoc2.IsExploded () HTH

Reply to
kevin.p.kenny

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

Reply to
david

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.