> For the complete documentation index, see [llms.txt](https://scripting.karamba3d.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripting.karamba3d.com/2.-scripting-with-karamba3d-inside-grasshopper/2.8-the-python-3-component/2.8.1-hello-karamba3d.md).

# 2.8.1: Hello Karamba3D

In order to get started with Python3 scripting in Grasshopper place a "Python 3 Script"-component on the canvas. Details regarding its functionality can be found [here](https://developer.rhino3d.com/guides/scripting/scripting-gh-python/).

<figure><img src="/files/GMlVt530CiudKDRB5XuB" alt=""><figcaption><p>Fig. 2.8.1.1: A minimal K3D-model for retrieving the number of elements, materials and cross sections via Python 3.</p></figcaption></figure>

When Karamba3D is installed in your Grasshopper the following code retrieves properties of a Karamba3D model:

```
import Karamba

model = Model_in;

if not isinstance(model, Karamba.Models.Model):
    raise Exception("The input is not of type 'Model'")

print(f"Number of Elements: {model.elems.Count}")
print(f"Number of Materials: {model.materials.Count}")
print(f"Number of Cross sections: {model.crosecs.Count}")
```

The source code is explained in [section 2.1](/2.-scripting-with-karamba3d-inside-grasshopper/2.1-hello-karamba3d.md).

{% file src="/files/0srqSDT3IslBbFOZjEfw" %}
