Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Projected Surface in 2D [Difficult topic]
#1
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
Quote
#2
I don't even know what these are: https://phyton.com/

I'm not sure what you're trying to do, but it probably can't be done automatically until you write the code to make it happen automatically.
Quote
#3
It is in FreeCAD But I think I am on the wrong forum
Quote
#4
Perhaps not this question, but, reading the the who for statement
Quote:Who is FreeCAD for? A couple of user cases:
...
The programmer. Almost all of FreeCAD's functionality is accessible to Python. You can easily extend FreeCAD's functionality, automatize it with scripts, build your own modules or even embed FreeCAD in your own application.
Quote
#5
Yes, but this is more a forum where freecad isn't implemented I think.
Because most of the topics aren't related to 2 and 3D questions.
Although I think my question isn't that difficult.
Quote
#6
you are correct, but if you need python help (later on) you know where we are
Quote
#7
Yes that's true . I have posted the question also in the freecad forum but hadn't got an answer either.
Thanks in advance.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Programming Difficult math in Python Huntern 6 137 Oct-17-2019, 06:32 AM
Last Post: Huntern
  matplotlib recursion error when repeatedly displaying a surface AdeIsHere 0 85 Sep-19-2019, 04:36 PM
Last Post: AdeIsHere
  Very difficult challenge for me cristfp 1 295 Apr-01-2019, 08:45 PM
Last Post: Yoriz
  Why is basic Twitter Connectivity So Difficult? Not sure what I'm doing wrong. Oliver 0 500 Mar-10-2018, 12:38 PM
Last Post: Oliver
  Python installation difficult rajamugavai 2 770 Feb-27-2018, 02:18 PM
Last Post: sparkz_alot

Forum Jump:


Users browsing this thread: 1 Guest(s)