Getting Volume variable of body

Getting Volume variable of body

markaabo
Explorer Explorer
368 Views
1 Reply
Message 1 of 2

Getting Volume variable of body

markaabo
Explorer
Explorer

Hello,

So im trying to create an addon in python where i wanna have a little window where it always shows the volume of a selected body which will be selectable from a dropdown menu in the window

I am sadly new to creating addons for fusion and can't seem to find a way to get the volume variable for a body

Hope someone can help 🙂

0 Likes
369 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor

You can get the volume of a body using the BRepBody.volume property. I didn't fully understand what your desired UI will be like, but having a dialog displayed all the time that interacts with the current model can be done but is a bit tricky. Most of what you see implemented by an add-in are custom commands. They behave like standard Fusion commands in that they display a dialog while the command is running, but the dialog is dismissed when the command finishes, either by the user canceling the command, finishing the command, or running another command, which terminates the active command.

 

You need to implement a palette to have a dialog that remains visible while other commands are executed. This is much more difficult because the contents of the palette is defined using HTML and you need to handle events so the HTML can interact with your add-in, which then interacts with Fusion. It also becomes more complicated if the contents of the palette needs to change when you change which document is active. It's complicated enough that it's probably not the best program to start learning Fusion's API.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes