I’ve troubles with area dimension regarding its style.
It’s a bit annoying that Rhino doesn’t remember the last setting and is always starting with “Style=Leader”.
But the worse part I couldn’t get around is, how to get the calculated area being better formatted. Having an rectangle for e.g. 500 cm x 876 cm the area dimension displays 438000.
I do not check out, where to globally set the font (style, size, …) that will be used for the text.
Instead of 438000 cm² I tried to force Rhino to display 43,80 m² instead. The Area operation has no option to do that.
Using mathematical operations doesn’t seem to work either in Textfields
Any ideas how to get around it
I’m also missing the option to select multiple closed curves at once and Rhino will display the calculated area for each region.
What should be improved on that:
because it is just generating a text, changing the size of a closed curve does not reflect on the corresponding area dimension. This would come true using leaders, but the leader line is annoying.
Text position is not well done. One idea is to give opportunities like LeftTop, LeftBottom, Center, OffsetX/OffsetY
dimension unit and/or scale factor can be made working better together (currently the unit “m2” is hard coded)
I am not a programmer at all, but I can open the rvb script in Notepad. Is there a way to update the script so that it converts/ divides the area into a new unit? For example, I work in inches, but want area in sq.ft. So I want the inch areas divided by 144. If that can be written into the script, I could find that line of code and save it as a separate script (CalcAreaSqFt) for example. Then you could make another copy for metric, etc. Probably easier than writing a GUI.
I am getting an error after choosing the closed curves that notes:
Source: Microsoft VBScript runtime error
Error: Object doesn’t support this property or method: 'Rhino.TextObjectFormula’
Is my VBS script in need of an update or is the Rhino script hitting an error inside Rhino?
Well, I’m not sure that’s possible right now using text fields… The text field “area” is an internal calculation and does not appear to have any options as to unit output - looks like it uses the file units, period. So I’m not sure how to get an updatable field that includes a conversion factor in this case.
It doesn’t error out on line 68 here, so maybe your Rhino/Rhinoscript is out of date?
@pascal looks like an extension of text fields to allow calculations would be a good addition…
I’m not implying making the calculation in the text field; someone already noted that idea is currently unavailable. I was wondering if someone would be able to program that mini-calc (area divided by 144) into the rvb script. Then that particular script is really a “calc-area-from-file-in-inches_give-square-feet”.rvb file. No text field modified by the end user. I don’t know enough programming to do this myself.
So you don’t need a field that auto updates if you modify the object, but just a static area indication in the desired units?
You can try this : (edited, typos)
import rhinoscriptsyntax as rs
import scriptcontext as sc
def ccrv_filter(rhino_object, geometry, component_index):
if rs.UnitSystem() != 8:
#file is not in inches
print "File is not an inch file"
msg="Select closed curves for area mesurement"
if not objs: return
mult=1/144 #convert inches to sq. ft.
for obj in objs:
Thanks for the help. I’ll try to clarify what I’m hoping for.
From Pascal’s .rvb tweak (higher up on this email chain) of MillingGuy’s .rvb file, the multiple areas do show up and they do update if the curves are updated. That’s all fine.
WITHIN that same .rvb file, I am hoping that your line of code “Mult=1/144” can be added after it calculates the area. Then each text object will display the correct numbers I’m after.
Better still would be if the .rvb script would add up the summed areas of all the closed curves you select and create only one text object with the final sum tally (again, with the mult=1/144). Perhaps this is named as a different script, so you could call up either one by different commands within Rhino.
If these options are coded within the .rvb script, then the user has no need for Excel commands within the Text Properies dialog box.
I guess you didn’t understand what I was trying to tell you previously. As far as I know you can’t do that. That script is using a “text field” for the area calculation and you can’t introduce any supplementary calculations into those as far as I know. So anything else simple will have to be static.
I’ll have to look into the possibility of using History on a text object to do this, but I won’t have time in the next few days…
You could also try the following Grasshopper definition. For all referenced curves it will calculate the area divided by 144; if there are more than one selected it will also give you the total area off to the right of the objects. It will ignore open curves. You can change the conversion factor for other scales if you want; you may need to change the text size and/or offset slider limits depending on the type size you want…
You can bake the text tags if you want them in the file as text objects, but then of course they become static.