Calling gha static method from GhPython

I’ve declared a method in my visual studio
public static bool Func(Curve a, ref Curve b) {...}
When I try to call it from GhPython I get this error


I’ve done the clr import and added reference to the gha/dll. Intellisense is even working. I’ve also made the type hint on x and y as Curve

How are you calling it from python?
There is an example here of using strongbox/clr.referernce with python. Maybe this helps?

is this because of the ref keyword? sorry I missed it at first. I’ve added it to my original post

oh yeah found it
crv = clr.StrongBox[Rhion.Geometry.Curve](rhcrv)
now I can push that crv through

I’m not entirely sure.
What function are you calling, (I assume something that you wrote in C# in Visual Studio and it’s loaded in the current GH document?)
From the error, I am guessing that your function in C# probably has out parameters. Python doesn’t have those, (not directly at least), so you need to mimic them…
As I’m typing…I see you replied.

thanks a lot

1 Like