Hello World! Grasshopper for Beginners (6)

by Tuğrul Yazar | January 17, 2023 15:37

Let’s continue the Grasshopper for Beginners[1] series. We start with the traditional “Hello World!” displayed on the Rhino screen:

Hello World!

Placing the Components

In most CAD programs, the text creation function, which is the equivalent of the Text command, is performed by a component called Text Tag (Tag) in GH. The Text Tag (Tag) component is in the Dimension panel under the Display tab. If you’re not comfortable with tabs and panels yet, you can revisit this section from the beginning. If you remember, it was possible to find the component, not from the tabs, but using the search bar. When you find the Text Tag (Tag) component, select it and place it by left-clicking on an empty part of the canvas.

Hello World!

Now place a Construct Point (Pt) component on the canvas. It’s in the Point panel under the Vector tab:

Hello World!

When we take the Construct Point (Pt) component and click on the canvas, a small red cross will appear on the Rhino screen. Congratulations, you have created your first GH object!

When we left-click the Construct Point (Pt) component on the canvas, it will turn green. The red cross on the Rhino screen will also turn green. Also, we cannot select that object from the Rhino screen. There are various labels on the left and right sides of the Construct Point (Pt) component. The Text Tag (Tag) component has letters only on the left. We’ll look more systematically at what all this means in the next section.

Making Connections

Now let’s connect the Construct Point (Pt) component with the Text Tag (Tag). For this, we must position the Construct Point (Pt) on the canvas to be to the left of the Text Tag (Tag). If yours is not in the correct position, drag the components by holding down the left mouse button until they look approximately like the figure below. There is a small ledge next to the Pt symbol on the right side of the Construct Point (Pt) component. If you hold down the left mouse button on this projection and pull the mouse, you will see a dashed line and an arrow shape appear at the end. Keeping the left mouse button pressed, move this arrow to the tab marked L on the left side of the Text Tag (Tag) and release the left button.

Hello World!

If you made a connection incorrectly or want to delete it, reconnect it with the mouse while holding down Ctrl. Alternatively, you can use the Disconnect option from the right-click menu. Finally, place a Panel component on the canvas using one of the methods you learned earlier.

Hello World!

This yellow box, called the panel, is nothing like the other two components. Double left-click on the box that says “Double click to edit panel content…” and type the text “Hello World!” (Merhaba Dünya![2] in Turkish). You will need to click on an empty area of ​​the canvas to exit after the change is finished.

Now connect the tab on the right side of the Panel to the T icon on the left side of the Text Tag (Tag) component. The Text Tag (Tag) component should no longer be orange, but gray like the Construct Point (Pt).

Conclusion

If all went well, on the Rhino screen, a tiny red “Hello World!” (Merhaba Dünya!) text should appear. We cannot select this text from the Rhino screen. Thus, it will not zoom in. We connected these components from left to right and made the components work together to perform the desired operation. When you change the text on the panel, the text on the Rhino screen will also be updated. In this section, we got general information about GH and saw how it works with a little experimentation.

Endnotes:
  1. Grasshopper for Beginners: https://www.designcoding.net/category/tools-and-languages/grasshopper/
  2. Merhaba Dünya!: https://tr.wikipedia.org/wiki/Merhaba_d%C3%BCnya_program%C4%B1

Source URL: https://www.designcoding.net/hello-world-grasshopper-for-beginners-6/