# Understanding the Grasshopper Script

The Grasshopper script allows you to program the Robot and convert geometry from Rhino into toolpath geometry. Step through the following guide in order to program the Robot correctly.

**Functions of the Script**

The script has been colour coded to categorise the function of each component with the overall process.&#x20;

<figure><img src="/files/2ypjKXCw37HW5SlxIatG" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/sI8c6FfWyEDtu7VtiEfc" alt=""><figcaption></figcaption></figure>

**Name your file**

Keep your naming convention simple. Avoid any special characters or long names, as this file name is what will be visible in the Robot interface. Start your name with a **letter** to avoid a Robot error. \
\
\&#xNAN;*For example:* Nigel\_test\_01.

<figure><img src="/files/6YLZfwwXBSbUhpLQmB59" alt=""><figcaption><p>The left-hand side of each group outlines the function of the corresponding function</p></figcaption></figure>

**Robot Parameters - Connecting to the Robot**

Ensure you have connected to the **Unimelb - IRB1200** for the **Large Extruder.**\
Alternatively, if you are using the Small Extruder you will need to connect to the Unimelb - IRB120.

<figure><img src="/files/gvB16lCj2IkEc4YQnAR8" alt=""><figcaption></figcaption></figure>

**Converting objects to toolpath geometry**&#x20;

Depending on the type of geometry, the script requires an input of either a series of curves or a solid geometry which it will translate into toolpaths.&#x20;

If you have a series of **multiple polylines or curves** which make up your geometry, you will need to select your curves in **sequential order of printing** before you **\[right-click]** and select **\[Crv]**. The script&#x20;

<figure><img src="/files/90rZJaLx7JXiK7vZ3rlt" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/mhdOjJrhErBPwzLGpYVF" alt="" width="563"><figcaption></figcaption></figure>

**Print preview:** Using the functions in the **Simulation and Prin**t panel, slide the simulation bar in the script to ensure the robot toolpaths have been generated correctly.&#x20;

<figure><img src="/files/9YMkTWsmoMgcaGRXkkby" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ms-kb.msd.unimelb.edu.au/msd-robotics-lab/prepare-for-printing/understanding-the-grasshopper-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
