> For the complete documentation index, see [llms.txt](https://docs.layermanager.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layermanager.xyz/developer-manual/get-started.md).

# Get started

{% hint style="info" %} <mark style="color:blue;">**Prerequisites**</mark>**:** Windows; Visual Studio; Rhino 7; [RhinoCommon templates for VS](https://developer.rhino3d.com/guides/rhinocommon/installing-tools-windows/)
{% endhint %}

Make sure that the <mark style="background-color:yellow;">Rhino-Plugin Lama is running</mark> and you have <mark style="background-color:yellow;">loaded a LamaFile with a valid LamaLicense</mark>.

<details>

<summary>Step 1: Create project</summary>

Open Visual Studio -> Click "Create a new project" ->\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2F160yXcUqiCpI0FlZvFJh%2Fimage.png?alt=media\&token=ee4fa0ba-ba04-4a27-b56f-3160e37054b6)\
\
-> Search for RhinoCommon -> Select RhinoCommon Plug-In for Rhino 3D (C#) ->\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2F8SfBek2MIKoCvJvPiweB%2Fimage.png?alt=media\&token=f826e1c4-f99f-4b2f-8dbf-c106c647a1fa)

-> Enter a project name and select location -> Click "Create" ->\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FAxNxBNbnnck2S55JVzqz%2Fimage.png?alt=media\&token=b9c7ddb6-ef8d-495f-8b43-d8d15921c984)

-> Use standard setting (or customize) -> Click "Finish"![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FpAetDB5j5WOPBZoh21xU%2Fimage.png?alt=media\&token=61ab32e0-1796-415e-9198-cd1f6f244f8d)

</details>

<details>

<summary>Step 2: Install LayerManager</summary>

**1)** Update RhinoCommon version

Right click on RhinoCommon -> Update ->

![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2F2GTsG4v562UVsgHwnTR2%2Fimage.png?alt=media\&token=be25b3c1-0316-43d2-8b7a-857b87f3c516)

-> Search for "RhinoCommon" -> Select Version (see here) -> Update

![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2F3xLsJOmQpFZdDXgjRg2l%2Fimage.png?alt=media\&token=a8a9ca1d-8625-4a4e-9542-3cfafd4f8ed3)

**2)** Install LayerManager NuGet-package

Solution Explorer -> Right click on "Packages" -> Click "Manage NuGet Packages" ->\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FFZ49JZTvCQKbZLqFq1aw%2Fimage.png?alt=media\&token=cb2f10d9-49ce-4918-9de5-a509cd001222)

-> Select "Browse" -> Search "LayerManager" ->\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FMulqZLZrNlAa0zhrJIAH%2Fimage.png?alt=media\&token=07884680-e734-4333-a0c5-09736960359b)

-> Scroll down (potentially) -> Select LayerManager -> Click "Install"\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FaHSKWsL2YyIew2X7HNK2%2Fimage.png?alt=media\&token=9fa998cf-f013-4f13-b294-29ba961f30f1)

**3)** If not yet set, update C# to version 9.0 or higher

Double click on project -> Update LangVersion

![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FEcQ09frBTo8ktD817uxn%2Fimage.png?alt=media\&token=10124a33-2966-4083-b8e5-7e7544c884c0)

</details>

<details>

<summary>Step 3: Insert code</summary>

Replace code in MyFirstLamaCommand:

```csharp
using Rhino;
using Rhino.Commands;
using Rhino.Geometry;
using Rhino.Input;
using Rhino.Input.Custom;
using LayerManager.Base;
using LayerManager.Data;
using LayerManager.Parser;
using System;
using System.Collections.Generic;

namespace MyFirstLamaPlugIn
{
    public class MyFirstLamaCommand : Command
    {
        public MyFirstLamaCommand()
        {
            // Rhino only creates one instance of each command class defined in a
            // plug-in, so it is safe to store a refence in a static property.
            Instance = this;
        }

        ///<summary>The only instance of this command.</summary>
        public static MyFirstLamaCommand Instance { get; private set; }

        ///<returns>The command name as it appears on the Rhino command line.</returns>
        public override string EnglishName => "CreateLamaTables";

        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            // Get LamaBase
            LamaMainParser lmMainParser = new LamaMainParser();
            LamaBase lmBase = lmMainParser.ReadLama();
            if (lmBase == null)
            {
                RhinoApp.WriteLine("Lama could not be read.");
                return Result.Failure;
            }

            // Create LamaModel
            LamaModel lmModel = lmBase.NewLamaModel();
            lmModel.Name = "MyLamaModel";
            lmBase.Models.Add(lmModel);

            // Create LamaProject
            LamaProject lmProject = lmModel.NewLamaProject();
            lmProject.Name = "MyLamaProject";
            lmModel.Projects.Add(lmProject);

            // Write LamaModel and LamaProject to LamaFile
            lmMainParser.WriteLama(lmBase);

            // Create LamaData
            LamaData lmData = lmProject.NewLamaData();

            // Create Categories
            LamaCategory catGeneral = new LamaCategory("General");
            lmData.LamaCategories.Add(catGeneral);

            // Create Tables      
            DropdownTable tableComponent = new DropdownTable("Component");
            tableComponent.AddLayerRow("ComponentA");
            tableComponent.AddLayerRow("ComponentB");
            tableComponent.AddLayerRow("ComponentC");
            lmData.LamaTables.Add(tableComponent);

            BoolTable tableBearing = new BoolTable("Bearing");
            lmData.LamaTables.Add(tableBearing);

            NumberTable tableThickness = new NumberTable("Thickness");
            lmData.LamaTables.Add(tableThickness);

            TextTable tableCode = new TextTable("Code");
            lmData.LamaTables.Add(tableCode);

            RhinoElementTable tableWall = new("Wall");
            tableWall.AddClassColumn(tableCode, catGeneral, false);
            tableWall.AddClassColumn(tableThickness, catGeneral, false);
            tableWall.AddClassColumn(tableComponent, catGeneral, false);
            tableWall.AddClassColumn(tableBearing, catGeneral, false);
            lmData.LamaTables.Add(tableWall);

            // Write LamaData to LamaFile
            lmMainParser.WriteLamaData(lmData);

            // Start message
            RhinoApp.WriteLine("LamaTables created.");

            return Result.Success;
        }
    }
}
```

</details>

<details>

<summary>Step 4: Run the plugin</summary>

Click on ">\[YourProjectName]" or Press "F5" (Debugging) ->\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FgKPQxxMcWyXurFlHdRkl%2Fimage.png?alt=media\&token=68e4419c-8a21-40f1-9c80-00f6a4ad237f)

-> Rhino opens -> PlugIn is loaded automatically ->![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FxzqyRHrB9oLiSNVLAibk%2Fimage.png?alt=media\&token=86449aa9-88c8-460c-b672-a30328e9ccc6)

-> Enter your command "CreateLamaTables"\
![](https://2912411633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM8QsdAkZioZnHsW8B4Sc%2Fuploads%2FdgmhmQFgqbJANdeRycrd%2Fimage.png?alt=media\&token=a23cd1f1-33b7-49fc-916f-455207e61b28)

</details>

<details>

<summary>Result</summary>

In the LamaManager (Lama -> Manage), a new LamaModel and a new LamaProject were created.

Set the LamaProject as active (Right click -> Set active).

Now you can modify your LamaTables using the Rhino-PlugIn Lama!

</details>
