Facearea() returns the area of both inner and outer faces of raw geometry (not groups or components) within the tested group or component
2, need to divide by two to get outer (or outer) surface
it returns square inches even if the attribute dialog is cm
the first file shows a group of a 1m square, the attributes show the return and how to manipulate them to suit your need facearea_one meter square.skp (16.0 KB)
Next we consider a material, so divide the group’s raw geometry with a diagonal, paint one side, top 0020_Red
okay so for a group or component, Facearea returns area in square inches painted with the given material within that group or component
What if I go into the group or component and move the raw geometry? the attributes don’t update unless we do a redraw command on the closed object
Lets say we expose the Size attributes and change say lenX to 300cm? again the attributes don’t update, even with an external redraw. in this case one need to scale definition and redraw
you can make short cuts to these operations via windows / preferences /shortcuts
other data worth looking at…
the material from the material broswer must be in the model. However color made up from some of sketchups known colors Class: Sketchup::Color — SketchUp Ruby API Documentation.
or RGB values, or hexidemical values can be directly placed in the material attribute, this will paint all faces of the component or group, but as per the above reference to 44688/32 such can be exploded to make facearea give a result
Hi and thank you for your fantastic reply and the time you took to add files to help me.
I cannot get a meaningful result as yet.
I have attached 3 images which show all of the setting I have got for a test.
A single polygon/flat face 1000 mm x 1000 mm.
The result should be 10,000 square centimetres per face, meaning for my chosen function - both faces so 20,000 square centimetres.
Instead it is reading 1cm.
I am sorry I have no idea what I am doing wrong.
I have tried all possible variations of the settings and mostly get 0 or 0cm if lucky.
I have read your examples and tried over and over, but I must be missing some syntax ?
thank you
trombe
faces() returns the number of outer faces, => 1
facearea() returns area of both front and back in square inches
facearea(“a material or color”) returns total of faces painted in that material or color in square inches
Hi pc moor.
the penny finally dropped.
I am really surprised that even though my model/project file Units are in millimeters, SketchUp still gives an output in inches…hmmm.
Anyway now I have that all working and converted my formula looks like:
=facearea(“”)/2/144/10.76391
to give me an answer in square metres and with the Attribute Options set to Units = Default Text, Display In = End users model units, the use for all this can be started,
For a sheet of product like a sheet of plywood, plasterboard, MDF or flooring/walls/ceilings, I must ignore the sheet edges paradigm unless someone knows how to provide for the area of these edges in the Component ? they are small enough so as to not be an issue for me in taking off quantities of sheets or wall/ceiling planes for a building project however I would like to know who to provide for that condition if anyone has experience etc.
many thanks again for your support…
It would seem dynamic components are an unfinished project, with very little done to update or fix the issues. Another formula that returns inches is “current”, which is used to work on controlling the input when scaling or swapping.
Inches are the home grown units, so one has to respect the software engineers that work with their units.
It pays to set all your measurements to centimeters in the value of the Dc attribute, as SU will interpret any text as inches
with regards to the area for plasterboard, etc, it really depends on the amount of detail you intend to draw, however if you decide to model each sheet, then paint one inside color and have facearea report that, if you use blue then as per your sqft to sq m, =facearea(“blue”)/144/10.76391
It does take some effort and practice to understand the mind of the DC software creator
The internal units of a dynamic component can be set to inches or centimeters. The fields in the component options dialog can be set to display the units the user is currently using.
There is a long-standing bug in Dynamic components: when the “Display units format” in the Units dialog is unchecked, everything in a Dynamic component reverts to Inches. It is annoying, as the standard format for metric dimensions, especially mm and cm omits the unit text.
For this DC … in the above formula, I specifically used FACEAREA() with no material reference so that in a DC component I can specify any material from a predefined list and get that area.
In future would love to see FACEAREA read the MATERIAL variable and calculate that specific area.