Grasshopper

algorithmic modeling for Rhino

The double click popup window for inserting components accepts a number of different input formats. If you provide a plain component name (or the abbreviation or a word used in the description) then you will see a list of potential matches, sorted from most relevant to least relevant:

Some components and objects support initialisation codes, which means you can assign certain values directly from the popup box. You can do this by adding an equals symbol after the name and then the value you wish to assign. For example, the [Curve Offset] component allows you to specify the offset distance via the popup box by typing =5 after the offset command:

However the popup box also supports a set of special formats that allow you to create specific objects without even typing their names. As of 0.9.0077 (which hasn't been released yet at the time of writing) you can use the following shortcuts to create special objects. In the notation below optional parts of a format will be surrounded by square brackets and hashes (#) will be used to indicate numeric values. So #,#[,#] means;

at least two numeric values separated by a comma, with an optional second comma and third number.

A complete list of special formats (not all of these are supported yet in 0.9.0076):

  • "∙∙∙
    If the format starts with a double quote, then the entire contents (minus any other double quotes) will be placed into a Text Panel.
  • //
    If the format starts with two forward slashes, then the entire contents will be placed in a Text Panel.
  • ~
    If the format starts with a tilde, then the entire contents will be placed in a Scribble object.
  • #,#[,#]
    If the format contains two or three numerics separated by commas, a Point parameter will be created with the specified coordinates.
  • +[#]
    If the format starts with a plus symbol followed by a numeric, then an Addition component will be created.
  • -[#]
    If the format starts with a minus symbol followed by a numeric, then a Subtraction component will be created.
  • *[#]
    If the format starts with an asterisk symbol followed by a numeric, then a Multiplication component will be created.
  • /[#]
    If the format starts with a forward slash symbol followed by a numeric, then a Division component will be created.
  • \[#]
    If the format starts with a backward slash symbol followed by a numeric, then an Integer Division component will be created.
  • %[#]
    If the format starts with a percent symbol followed by a numeric, then a Modulus component will be created.
  • &[]
    If the format starts with an ampersand symbol, then a Concatenation component will be created.
  • =[]
    If the format starts with an equals symbol, then an Equality component will be created.
  • <[*]
    If the format starts with a smaller than symbol, then a Smaller Than component will be created.
  • >[*]
    If the format starts with a larger than symbol, then a Larger Than component will be created.
  • [# *] Pi
    If the format contains the text "Pi" with an optional multiplication factor, then a Pi component will be created.
  • #
    If the format can be evaluated as a single numeric value, then a Slider will be created with the specified initial value and sensible™ lower and upper limits.
  • #<#
    If the format contains two numerics separated by a smaller than symbol, a Slider with the specified limits will be created. The initial slider value will be equal to the lower limit.
  • #<#<#
    If the format contains three numerics separated by a smaller than symbol, a Slider with the specified limits will be created. The initial slider value will be the value in the middle.
  • #..#
    If the format contains two numerics separated by two or more consecutive dots, a Slider with the specified limits will be created. The initial slider value will be equal to the lower limit.
  • #..#..#
    If the format contains three numerics separated by two or more consecutive dots, a Slider with the specified limits will be created. The initial slider value will be the value in the middle.
  • #/#/[#]
    If the format contains two or three numerics separated by  forward slashes, a Calendar object will be created. The order of value is day/month/year. If year is omitted then the current year is used. Note that a second slash is required because #/# is interpreted as a number and thus results in a Slider.
  • #:#[:#] [am/pm]
    If the format contains at least two numerics separated by a colon, a Clock object is created. Seconds are optional, as are am/pm suffixes.

  • f([...[,...[,...]]]) [= *]
    If the format starts with a lower case f followed by an opening bracket, an Expression component is created. A list of comma separated arguments can be provided as inputs, and anything after the optional equals symbol becomes the expression string.

Note that decimal places will be harvested from formats that indicate sliders. I.e. the format 0..2..10 is not the same as 0..2..10.00, as the former will create an integer slider from zero to ten whereas the latter will create a floating point slider with two decimal places from zero to ten.

Views: 12361

Replies to This Discussion

Does this make sense as well? Vbscript(phi,rho,gamma) or taking it a step further Vbscript(P as point3d, S as Surface)

Same for Cross Reference, Shortest List and Longest List? Sift, Combine Data?

Yes. Probably would be best to keep it limited to a sensible number though. 

The Expression shortcut doesn't seem to be working in v0.9.0076.  Did it get taken out?  (Or did it just never actually get put in?)

I don't think it was ever put in.
I would say, it would look something like thist:

double click >>> type >> exp("{0}, {1}", x, y)

containing inside the parentesis the same format as in the expression component.

if just exp( then an empty expression component

Hi!

Is there a way when creating a panel with " or // to automatically have it sized to the text within? 

So when i create a panel with a number that it will be a small panel.

Kind regards,

Rick

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service