Random string generator for Grasshopper
As a bit of something quick and fun, I produced a random string generator component for Grasshopper. It’s a simple component with three inputs to control the number, length and chars included of strings and returns one output, a list of randomly generated strings. Quite what you’d wish to use this for I don’t know, but should you ever need a list of random strings for another component, then you could use this component.
Inputs
The component has three inputs, but all of them are optional. The component contains default values to produce one random string of 8 characters in length using all of the letters and numbers of the English alphabet.
Input | Expected Values | Comments | Is Optional? |
_NumString | A number (from a slider bar for example) | This is how many strings you wish to create | Yes – default is one string |
_StringLength | A number (from a slider bar for example) | This is how long you wish each string to be | Yes – default is 8 chars length |
_CharBase | Characters (from a panel), for example “ABC” | This is which characters you want your strings to contain. E.G. if you only have “ABC” plugged in, your strings will be combinations of “ABC” | Yes – default is every letter and number in the English alphabet |
You can download a copy of this component here. Feel free to play and let me know what you use it for beyond a bit of fun – I’d be interested to know if there are proper Grasshopper uses for this component.