I’d like to have some simple Excel-like math functionality in a table inside a Rhino document. This could be extended to auto-update any text object anywhere in the document, not just a table format.
My understanding of excel tables is that each cell has at least three properties:
Address: A1, B1, C1, etc.
Formula: none, none, =A1+B1, etc.
Displayed Text: 2, 2, 4, etc.
To replicate this in Rhino, a text object would have the following user attributes:
The Displayed Text attribute is grabbed with a text field to auto-update the actual text inside the text object.
Then a grasshopper script or C# script (preferably C# command eventually) is needed to evaluate the formulas:
- Either: select all text objects in document, or: use selected text objects
- Evaluate Formula attribute of all selected text objects, using Addresses in Formulas as variables.
- Update Displayed Text attribute for all selected texts based on formula output. Do nothing if no formula.
I’m stuck on the formula evaluation script (I have minimal code knowledge). I can’t quite get it to work in grasshopper or in a GH C# component using ChatGPT.
ExcelinRhino.3dm (50.0 KB)
ExcelinRhino.gh (22.5 KB)
Anyone have some insight on this? Or perhaps I’m reinventing the wheel and you’ve already solved this problem?