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


Messages In This Thread
Projected Surface in 2D [Difficult topic] - by Hans_K - Aug-01-2017, 12:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  difficult string conversion need help Pir8Radio 3 1,093 Nov-27-2022, 06:15 PM
Last Post: Gribouillis
  Confusing in [for loop] topic Sherine 11 3,626 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,614 Mar-31-2021, 03:39 AM
Last Post: Larz60+
  Calculating surface area - - OOP or functional? Derek Banas Udemy course Drone4four 5 3,665 Mar-13-2021, 06:22 AM
Last Post: buran
  3d Surface where Z is not a function of X and Y richterjan 2 1,766 Nov-11-2020, 04:22 PM
Last Post: michael1789
  [split] New thread/topic rajp1497 1 1,918 Sep-24-2020, 01:55 AM
Last Post: micseydel
  Plotting 3D surface plot for non-linear multivariate regression with 5 variables khwajaosama 0 2,726 Jul-02-2020, 04:50 AM
Last Post: khwajaosama
  How to solve difficult non-linear equations? shreeniket 3 2,414 Apr-23-2020, 01:36 AM
Last Post: shreeniket
  subscribing to kafka topic/key georgelza 10 4,369 Jan-03-2020, 04:58 AM
Last Post: georgelza
  Programming Difficult math in Python Huntern 6 4,833 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