API Access for "Show All"

API Access for "Show All"

ebunn3
Advocate Advocate
597 Views
2 Replies
Message 1 of 3

API Access for "Show All"

ebunn3
Advocate
Advocate

Please see screenshot below.  I am looking for a function that will allow me to hide or show everything in a Component like what is available by right clicking on the component in the browser tree.  I'd prefer not to have to go through each body and set its visibility to False or True.  I have components that contain hundreds of bodies and looping takes up a lot of time.

Eric

 

ebunn3_0-1637682544470.png

 

 

 

0 Likes
Accepted solutions (1)
598 Views
2 Replies
Replies (2)
Message 2 of 3

tykapl.breuil
Advocate
Advocate
Accepted solution

Hey there !

 

I don't know of any way to do it properly by the api (except by looping). However you can, through the api, automatically select the occurrence whose bodies you want to reveal and then activate the command :

        sels = ui.activeSelections
        sels.clear()
        sels.add(occurrence)
        ui.messageBox(occurrence.name)
        app.executeTextCommand('Commands.Start ShowAllBodiesCmd')
        sels.clear()

See @kandennti 's post on textCommands for an explanation :

-Use TextCommands - Autodesk Community - Fusion 360 

-Use TextCommands2 - Autodesk Community - Fusion 360 

And his (truly wonderful) addin :

-Devtools 

Message 3 of 3

ebunn3
Advocate
Advocate

Perfect.  Thanks.  I need to learn more about using these text commands.  

Eric

0 Likes