Grasshopper

algorithmic modeling for Rhino

Hey guys,

I wrote some components between which i want to exchange custom classes.

It all works fine until I update my code, an insert the new .gha again. I always get this error
"1. Invalid cast: ObjectWrapper » MyClass"

Once I restart Rhino it works fine with the new code, but this kind of interrupts the work flow.


I added my input as:

pManager.AddGenericParameter("","","",GH_ParamAcces.item);

the output is Generic as well.



My class looks like this:

namespace MyComponent
{
public class MyClass
{
public GH_Point point { get; set; }
public string text { get; set; }

/// constructor

public MyClass(GH_Point Point, string Text)

{
  this.point = Point;
  this.text = Text;
}

/// empty constructor
public MyClass()
{
  this.point = new GH_Point();
  this.text = new string();
}

public override string ToString()
{
  return string.Format("MyClass");
}

}
}


Does anyone have a hint for me?

Thanks in advance
Benjamin

Views: 914

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service