Report face surface
-
Here is a quick script that sums areas by material. It doesn't dig into groups or comps.
-
To find areas of materials inside groups/components... [pseudo-coded]
txt="" model.definitions.each{|defn| insts=defn.instances num=insts.length next if num==0 mats=[] defn.entities.each{|e| next if not e.class==Sketchup;;Face mats << [e.material, e.area] } txt << num.to_s+"\n" mats.each{|m| txt << m[0]+","+m[1]+"\n" } } ###... puts txt
and so on to assemble a list of materials with areas within definitions. multiply by 'num' to get total area of all instances of each definition etc etc...........
-
@unknownuser said:
multiply by 'num' to get total area of all instances
Not that simple, don't forget that instances can be scaled... -
@didier bur said:
@unknownuser said:
multiply by 'num' to get total area of all instances
Not that simple, don't forget that instances can be scaled...
I realize that but he has to start somewhere -
This is great. Thanks everybody! Definitely a start that I can work with. At the moment, I don't need to worry about scaled instances of components, so I'll be able to use this and expand it's functionality as I need it. Thank you everybody.
-
These scripts are very useful. However, I am wondering if it is possible to go further with this to help me with what I use sketchup for. I draw a 3d floor plan of a house which is basically just lots of boxes/rooms adjoining each other. For each room I need the area of each wall and its orientation. However the orientation is from the perspective of being inside that room. So say I am inside the room and I am looking at the wall in question, the orientation of the wall is basically the direction I am facing, for example North. If I was in the room adjoining and am now looking at the same wall but from the other side of it, the orientation is now the opposite direction ie south. These scripts dont quite cater for this and I am wondering if it is even possible to make such a script. So when i click on one side of a wall its orientation is one direction but if I click on the other side of it, its orientation is the opposite direction.
Advertisement