I have heard whispers of maths that include not only numbers and symbols, but letters as well, but have done my best to avoid them so as to be able to sleep at night.
I think that adding basic functionality (+, -, *, /) would satisfy most if not all basic input⌠SketchUp will likely never replace a graphing calculator, but I feel that the basics would be an amazing way to start!
I think it will be a useful evolution if the VCB could allow any characters after the first character when it is a digit or a special character like (+*-/=@#?â etcâŚ, so that full formulas and units are allowed for input.
Currently, only some non-digit are allowed, and shortcuts are not disabled, so that depending on your shortcut assignments, some characters would go to the VCB or trigger a shortcut (see this post).
Possibly, a gold key could be agreed (say = or @) that would popup a window with more capabilities to enter formula, including with variables, math functions, etcâŚ. Scripts could design their own dialog. (Note: this cannot be done currently, because the API onKeyDown returns char codes, not a character).
key.chr will return the corresponding character, no ? Thatâs what I use to capture the âXâ characterhere.
Unfortunately, mixing all the operators is not as simple as it seems if the result is to be a length.
Currently when a user type 123, this value is converted to 123u, where u is the model length unit.
Adding (+) or subtracting (-) one length from another is not a problem. However, multiplying (*) and dividing (/) is. For both operations, one of the two operand is no longer a length, but a factor.
But where is the factor and where is the length in 100*2 ?
10â/2 if model unit is millimeters, for example will be computed as 10â / 2mm, Which is not the expected result.
onKeydown and onKeyUp returns virtual keys, not ascii or Unicode value. So this depends on the operating system, the language of the keyboard and maybe other parameters of the computer environment.
Thereseems to be no Ruby method to perform the translation of a sequence of virtual keys to a regular character
I was inspired by this thread by Boris so I tried my hand at incorporating one of the suggestions to copy measurements with a âMathBoxâ extension. Similar functionality to whatâs shown above but I added memory slots. So, memory slots are stored to as: $1=, $2=, $3â, etc. Then those can be used in expressions in the VCB. For example, @+$1
MathBox
Not sure $ is the way to go but it avoids shortcut keys.
The â@.â symbol may also refer to the name of a parameter in the ascending hierarchy, this would save the tedious work of redefining the parameter in all descending levels (xxx= Parent!xxx)
Still based on Justinâs video, which advocates for more modeling tools, wouldnât it be time to define a parameter type for angle? When editing a component by selecting two edges, it would be possible to define the angle between them using this new parameter type. This parameter type is native to REVIT and is very useful.
The protractor simply measures. My intention is to define the measurement between two edges as a parameter so that when the component is stretched, the angle between those two edges is preserved. Currently, the possibilities for creating parameters are limited to decimal numbers, text, and length. Mr. Aaron showed us how to make a picture frame. Sensational. But if it were possible to define a 45-degree angle between the frame edges, everything would be much simpler and more intuitive. REVIT users often use this approach to create parametric roof trusses, among other things.