I did something not quite as requested but close (I hope).
If the text inside the popup search starts with the following characters, then the appropriate component is created with the text after the special character evaluated as a value for the second input (except for Text Panels, as they don't have a second input):
" → Text Panel
// → Text Panel
+ → Addition
- → Subtraction
* → Multiplication
/ → Division
\ → Integer Division
& → Concatenation
% → Modulus
So you can type:
//Hello world
or
"Hello world
to get a panel with specific content.
I also made it so that when the text typed evaluates to a number (no expressions allowed, it has to be a single number), a slider is instantiated. So typing:
8
results in an integer slider and typing:
8.00
results in a floating point slider with two decimal places.
Danny Boyes
Hi Philip,
Are you aware of these Keyword entries:
Panel=Hello World!
Add=4
Division=2
If not the you can read more here: http://www.grasshopper3d.com/forum/topics/initialization-code-what-... and see a fairly comprehensive list of initialization code enabled keywords in the 0.8.0010 features.
BTW slider=50 gives you integers and slider=50.00 gives you real numbers to 2dp
If so, are you looking for further shorthanded keywords?
Sep 1, 2011
David Rutten
I did something not quite as requested but close (I hope).
If the text inside the popup search starts with the following characters, then the appropriate component is created with the text after the special character evaluated as a value for the second input (except for Text Panels, as they don't have a second input):
" → Text Panel
// → Text Panel
+ → Addition
- → Subtraction
* → Multiplication
/ → Division
\ → Integer Division
& → Concatenation
% → Modulus
So you can type:
//Hello world
or
"Hello world
to get a panel with specific content.
I also made it so that when the text typed evaluates to a number (no expressions allowed, it has to be a single number), a slider is instantiated. So typing:
8
results in an integer slider and typing:
8.00
results in a floating point slider with two decimal places.
--
David Rutten
david@mcneel.com
Leusden, Holland
Sep 3, 2011