Kangaroo : Error : Unable to cast GoalObject to IGoal

script
unhandled

#1

Hi there, recently I was learning how to use KangarooSolver.dll, I try using the examples(Dan Piker) on github but they all seem to give the same error, Error : Unable to cast “x GoalObject” to IGoal. Wearly the examples where the goal is created inside the script work perfectly but the examples where the goals are created using the kangaroo Goal Components give the error. I have no idea why the type casting fails. So I was wondering if this is common error and if there’s any solution. Thanks

IGoal Error.gh (15.0 KB)


#2

It works fine for me, in Rhino6:

bild

// Rolf


(Daniel Piker) #3

I’d guess this is something to do with the assembly reference location - because rhino 6 includes it’s own copy of the kangaroo DLL, you need to make sure the script loads that one, not the one you have for rhino 5


#4

Probably yes. Below the versions I have installed (for R5 and R6)

The path to the version being used by Antonio:

// Rolf


#5

Yep, that was the problem, I need it to restart Rhino after referencing the assembly, I just assumed the assembly have loaded because I was able to access some of the classes, thanks both!!.