Python Forum
Projected Surface in 2D [Difficult topic]
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
Reply
#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.
Reply
#3
It is in FreeCAD But I think I am on the wrong forum
Reply
#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.
Reply
#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.
Reply
#6
you are correct, but if you need python help (later on) you know where we are
Reply
#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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  difficult string conversion need help Pir8Radio 3 1,044 Nov-27-2022, 06:15 PM
Last Post: Gribouillis
  Confusing in [for loop] topic Sherine 11 3,488 Jul-31-2021, 02:53 PM
Last Post: deanhystad
  creating simplex tableau pivot program easy or difficult for a beginner in Python? alex_0 2 2,565 Mar-31-2021, 03:39 AM
Last Post: Larz60+
  Calculating surface area - - OOP or functional? Derek Banas Udemy course Drone4four 5 3,572 Mar-13-2021, 06:22 AM
Last Post: buran
  3d Surface where Z is not a function of X and Y richterjan 2 1,711 Nov-11-2020, 04:22 PM
Last Post: michael1789
  [split] New thread/topic rajp1497 1 1,867 Sep-24-2020, 01:55 AM
Last Post: micseydel
  Plotting 3D surface plot for non-linear multivariate regression with 5 variables khwajaosama 0 2,699 Jul-02-2020, 04:50 AM
Last Post: khwajaosama
  How to solve difficult non-linear equations? shreeniket 3 2,377 Apr-23-2020, 01:36 AM
Last Post: shreeniket
  subscribing to kafka topic/key georgelza 10 4,222 Jan-03-2020, 04:58 AM
Last Post: georgelza
  Programming Difficult math in Python Huntern 6 4,746 Oct-17-2019, 06:32 AM
Last Post: Huntern

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020