# 3.3: How to Reference Karamba3D Assemblies

In order to package the script of section [2.4.2](/2.-scripting-with-karamba3d-inside-grasshopper/2.4-how-to-modify-structural-models/2.4.2-activation-and-deactivation-of-elements.md) into a GH-component there needs to be one input-plug that receives a Karamba3D model. Three output plugs return an updated Karamba3D model, a list of boolean values that signifies which elements are active or not and the value of the largest resultant displacement.

The following example can be found in the examples that accompany this guide. Go to **“#/TensionElim”** and double-click on **“TensionElim.sln”** to open the project with Visual Studio. Depending on what version of Grasshopper you use it will be necessary to reestablish the project references.

**Referencing Required Libraries**: To use Karamba3D classes (e.g., the `Model` class), you must reference the `karambaCommon.dll` library. There are two ways to do this:

* **Using the KarambaCommon NuGet Package**:
  * In Visual Studio, go to **Tools > NuGet Package Manager > Manage NuGet Packages for Solution...** and install the `KarambaCommon` package.
* **Referencing the Installed Library**:
  * Right-click **References** in the Solution Explorer and select **Add Reference...**.
  * In the tabbed view, go to **Browse** and locate the `karambaCommon.dll` file in Rhino’s **Plug-ins** folder.

**Including `karamba.gha`**: Since Karamba3D will be used in Grasshopper, you must also reference `karamba.gha`. However, Visual Studio does not natively allow `.gha` files to be selected. Use the following workaround:

* Save and close your Visual Studio project.
* In the project directory, locate the `TensionElim.csproj` file and open it in a text editor.
* Search for the `karambaCommon` entry, copy it, and modify it to reference `karamba.gha` (see Fig. 3.3.1 in the guide).
* Save the file and reopen the project in Visual Studio.

![Fig. 3.3.1: Work-around for referencing "karamba.gha" in Visual Studio: Edit the "TensionElim.csproj"-file](/files/-MXH_8rRzU7AbedXEH2W)

**Adjusting Reference Properties**:

* After adding `karamba` and `karambaCommon` references, right-click each reference in **Solution Explorer** and select **Properties**.
* Set the **Copy Local** property (default: `True`) to `False`.

Following these steps ensures the script is properly packaged into a custom Grasshopper component for use with Karamba3D.


---

# 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://scripting.karamba3d.com/3.-how-to-create-your-own-karamba3d-grasshopper-component/3.3-how-to-reference-karamba3d-assemblies.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.
