Skip to content

API C#

Not yet made public. Under development.

The Inkbeagle.Data namespace provides classes that are used to implement the core services of the Inkbeagle Data framework.

Installation

NuGet

Grasshopper C#

Initialize object

InkObject

An empty InkObject can be initialized as follows:

Using Inkbeagle.Data;

InkObject iObj = new InkObject();

Add/Edit values

Values can be added to the object's dictionary, associated with a specified key. The following types are currently supported: int, double, string, and bool. When a key does not exist yet, a new KeyValuePair<string,TValue> is added. When a key already exists, the corresponding value is overwritten.

Primitive data types

InkObject iObj = new InkObject();

iObj.AddInteger((string)"my_key_0", (int)5);
iObj.AddDouble((string)"my_key_1", (double)4.23);
iObj.AddString((string)"my_key_2", (string)"My string value");
iObj.AddBool((string)"my_key_3", (bool)true);

Geometry data type

To be implemented.

iObj.AddGeometry((string)"my_key_4", (xxx)xxx); // To be implemented

Remove key

string key = "my_key_0";
iObj.removeKey(key);

Get value

int? myInteger = iObj.TryGetInteger((string)"my_key_0");
double? myDouble = iObj.TryGetDouble((string)"my_key_1");
string myString = iObj.TryGetString((string)"my_key_2");
bool? myBool = iObj.TryGetBool((string)"my_key_3");

Grasshopper

C# component

GH_InkObject

Using Inkbeagle.Data;

InkObject iObj = new InkObject();
GH_InkObject gh_iObj = new GH_InkObject(iObj);