In brief
- Add the Python 3 Script component from the `Script` panel in Grasshopper’s `Maths` tab.
- Input parameters offer Item, List, and Tree access options.
- Type Hint can convert input data to the selected type before the script runs.
- Disabling the unused standard output parameter can reduce unnecessary processing, especially in definitions with many components.
This guide is based on Rhino’s developer documentation for Grasshopper Python scripting, updated on 29 September 2026. You can add a Python 3 or IronPython 2 Script component in Grasshopper, or select Python 3 from the language menu in the general Script component. The steps below focus on configuring the component’s inputs, data access, and outputs before generating geometry. The documentation notes that some options depend on the Rhino version; for example, the option to make an input parameter required is available as of Rhino 8.14.
1. Add and name the Script component
Add the Python 3 Script component from the Script panel in Grasshopper’s Maths tab. Alternatively, place the general Script component and select Python 3 from its language menu. Double-click the component to open the script editor; the status bar shows which Python language version is in use.
Scripts are usually embedded in the component rather than saved as separate files. If a definition contains multiple scripts, rename each component with a descriptive name. The Script tab and breakpoints panel reflect that name. Give input and output parameters meaningful names too, so anyone inheriting the definition can more easily understand what data it expects and produces.
2. Set up a first script with inputs and outputs
By default, the Script component includes x and y inputs and out and a outputs. Remove any parameters you don’t need. Controls for adding or removing inputs and outputs appear when you zoom in close enough to the component. You can also remove all parameters from one side; the component will display that edge differently.
For a simple first test, add two numbers and assign the result to the a output:
a = x + yIn Script-Mode, the component defines the input variables before the script runs, then passes values assigned to output variables to the component’s outputs. For this example, connect compatible values to the x and y inputs. If the inputs are empty, their values may be None, and adding them will cause a runtime error. Because Python is not a type-safe language, incompatible operations can cause problems when the script runs.
3. Choose input types and data access
Setting a Type Hint by right-clicking an input parameter converts incoming data before the script runs. In the documentation’s example, two Line values are converted to numeric values using the float type hint, and the script adds them. Type Hint options are available for both input and output parameters. Check the connected data to confirm that the conversion produces the expected result.
Parameter Access in the parameter menu determines the scope at which the script handles data:
| Access | Structure passed to the script | When to use it |
|---|---|---|
| Item | Each data item is handled separately | To process items one at a time |
| List | Items in a branch are handled together | To process a branch’s list as a group |
| Tree | The entire data structure is handled together | To work with branches and items as a whole |
With Item access, a number appears as a single value on the Python side; with List access, the values in a branch appear as a list. Tree access provides access to the Grasshopper data tree. A type hint can also help specify the element type in a generic DataTree structure. Before choosing an access mode, decide whether the script will handle a single item, a list, or the entire tree.
4. Manage outputs and input requirements
The out parameter captures text produced by print() calls in the script. By default, each line becomes a separate output item. When Avoid Grafting Output Lines is enabled, printed lines are passed as a single item. If the script doesn’t print anything to the console, you can disable the out parameter using the component’s Standard Output/Error Parameter context-menu option.
Disabling an unused out parameter prevents the component from capturing and processing printed text. The documentation notes that the benefit may be small for a single component, but the change can matter more in large Grasshopper definitions where many components run thousands of times.
Script inputs are optional by default. If an input must always have data, use the Required option in the input parameter’s right-click menu. The official documentation says this option has been available since Rhino 8.14. Marking required inputs, especially before publishing a script, helps reduce the risk of running it with missing data.
Use in architecture and visualization workflows
For architects, interior designers, and visualization teams, these settings help turn repetitive modeling steps into a clearer Grasshopper definition. For example, identifying expected data through parameter names and specifying the input type makes it easier to hand a definition over to someone else on the team. Choosing Item, List, or Tree also determines whether the operation applies to individual items or a group of data.
This guide alone isn’t enough for more complex geometry: the source doesn’t cover the Rhino or Grasshopper APIs and directs readers to separate documentation for those topics. So first validate the workflow with a simple script and a small dataset, then move on to the production definition. Since these sources don’t provide information about workstation or licensing requirements, no additional hardware or cost recommendations are offered here.
Common mistakes
Overlooking empty inputs and operating on
Nonevalues: check that inputs are connected and have the expected type.Choosing parameter access without considering the script’s data requirements: Item, List, and Tree provide different data structures.
Leaving the unused
outparameter enabled: disable it ifprint()output isn’t needed.Using unclear parameter names: this makes the purpose of inputs and outputs harder to understand, especially in shared definitions.
Sources
1 sourceSource texts are not republished; short quotes are marked, everything else is our own summary and commentary.
For architecture and visualization offices in Turkey, the main value of these recommendations is not in upgrading hardware, but in making Grasshopper definitions more reliable and easier to hand over. Meaningful parameter names, the right data access mode, and required inputs can save time, especially when different team members use the same definition.
Disabling the `out` parameter may have a limited effect in a single component, but it can potentially reduce unnecessary processing in definitions with many components running intensively. It’s important to test changes in a real workflow and verify options that depend on the Rhino version. The sources don’t include hardware, pricing, or licensing information, so additional official documentation is needed to make decisions on those topics.
Frequently asked questions
How do I add a Python 3 Script component in Grasshopper?
Add the Python 3 Script component from the `Script` panel in Grasshopper’s `Maths` tab. If you’re using the general Script component, select Python 3 from its language menu.
What do Item, List, and Tree access mean in Grasshopper Python?
Item handles data one item at a time, List handles the items in a branch together, and Tree handles the entire data structure. Choose the mode according to how the script needs to process data.
What is the out parameter in the Grasshopper Python component for?
`out` captures content printed with `print()` in the script. If console output isn’t needed, you can disable it from the component’s context menu.



