API Call for Explode Status?

Discussion in 'SolidWorks' started by david, Sep 7, 2007.

  1. david

    david Guest

    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.
    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
     
    david, Sep 7, 2007
    #1
  2. retval = ModelDoc2.IsExploded ()
    HTH
     
    kevin.p.kenny, Sep 7, 2007
    #2
  3. david

    david Guest

    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
     
    david, Sep 7, 2007
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.