# 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="https://1398895201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyC6jmRm3s1g8XuGI1rR9%2Fuploads%2FeLpo55o8hpKEfJba05Fq%2FHelloWorld_py.png?alt=media&#x26;token=145086bd-2b66-4b3f-98df-f45080ea836c" 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](https://scripting.karamba3d.com/2.-scripting-with-karamba3d-inside-grasshopper/2.1-hello-karamba3d).

{% file src="<https://1398895201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyC6jmRm3s1g8XuGI1rR9%2Fuploads%2FN3e7U50ksCRIJYGCYjQz%2FHelloKaramba3D_Py3.gh?alt=media&token=216bed6d-e0b5-4404-a550-1d373e35de40>" %}
