I’m trying to put a code into the grasshopper c# component constructor:
public class MyComponent : GH_Component
{
public MyComponent ()
: base("My Component", "MC",
"For testing purposes",
"List", "Group")
{
private MyClass object = new MyClass();
// It throws error CS1513: '} expected'
}
Am I putting the code in the wrong place? Where I could put a code which will be executed only at the creation of component? Similar to putting code into ‘Custom additional code’ in Grasshopper C# Script component?