algorithmic modeling for Rhino
Hey there.
I am casting my custom type into an int in grasshopper, and everything is working, but very slowly. I'm getting 2 "invalid cast exception" for every cast, even though it's working. I'm suspecting this is why it's running slowly.
It's outside of my code, so I don't know what's wrong?
if (typeof(Q).IsAssignableFrom(typeof(int)))
{
object ptr = this.Value.Index;
target = (Q)ptr;
return true;
}
//Then, see if Q is similar to the GH_Integer type.
if (typeof(Q).IsAssignableFrom(typeof(GH_Integer)))
{
object ptr = new GH_Integer(this.Value.Index);
target = (Q)ptr;
return true;
}
Tags:
Hi Gustav,
any chance of getting a complete class which can be compiled and shows the problem?
Welcome to
Grasshopper
Added by morteza khorsand 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by