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
chanley
(Chris Hanley)
May 17, 2019, 7:46pm
2
How are you calling it from python?
There is an example here of using strongbox/clr.referernce with python. Maybe this helps?
Thank you for posting this Example! I was completely unfamiliar with Quaternions before this! For the sake of a learning exercise, I took a shot at converting your C# component to python. While I still am WAY out of my depth in regards to quaternions… What I ended up learning was how to use clr.StrongBox (or clr.Reference…both of which don’t autocomplete and took some digging to find!), to mimic C# out parameters! Reference mentioned here: (thanks @AndersDeleuran and @piac for posting that…
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
chanley
(Chris Hanley)
May 17, 2019, 9:08pm
5
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.