Aug-01-2017, 12:14 PM
Hello Phyton colleagues ,
The difficulties I face:
When I import a part in Freecad I want to know the projected surface of the part automatically.
In the Phyton code below, I have to :
1. Select the faces Individually
2. Run the script
3. Place all the values of the calculated areas in Excel so I can make an Autosum and have the total area.
This is a lot of work if there are more then 15 faces. Can this be improved in some other way? Automatic selection and calculation?
Notice: This is my third day I work with Phyton, The script I use is from the forum because I first searched if there was a solution to this problem.
I have installed the latest version of Phyton + Freecad.
I will check for answers regularly .
Thank you in advance.
Used script:
area = 0.0
>>> for o in Gui.Selection.getSelectionEx() :
... for s in o.SubObjects:
... area = s.Area
... print area
The difficulties I face:
When I import a part in Freecad I want to know the projected surface of the part automatically.
In the Phyton code below, I have to :
1. Select the faces Individually
2. Run the script
3. Place all the values of the calculated areas in Excel so I can make an Autosum and have the total area.
This is a lot of work if there are more then 15 faces. Can this be improved in some other way? Automatic selection and calculation?
Notice: This is my third day I work with Phyton, The script I use is from the forum because I first searched if there was a solution to this problem.
I have installed the latest version of Phyton + Freecad.
I will check for answers regularly .
Thank you in advance.
Used script:
area = 0.0
>>> for o in Gui.Selection.getSelectionEx() :
... for s in o.SubObjects:
... area = s.Area
... print area