The Rhinocommon method to create a spiral: rhino.geometry.nurbscurve.createspiral works fine in my Grasshopper script, but always fails and returns none when I send it via RhinoCompute/Hops. I have tested the code in both IronPython, Python and C# script components, and all return none. The expression component is used to flag the issue in Rhino.Compute as the script component doesn’t show the error.
Hmm. That’s weird. It appears to work here. I did have to modify your script to add some Context Get and Context Bake components so that Hops would be able to compute the definition. But, otherwise, I kept the script just as you had it.
Agh, yes, sorry, I had taken it from a much larger code and internalised all the data, but forgot to create new context components for the example. Glad to see it working there, and the bug must be something here. I am using the rhino.compute/hops with an external server to a website, not trying to read back into another GH definition. Could that be causing the issue? What’s also odd is that it was the only IronPython code module in the whole code that was failing, and I am using others, also calling Rhino Common methods, and they work fine.
I would recommend using the newer Python scripting component (not the older Iron Python component). The newer scripting component should work with Rhino.Compute and it is possible that this could be causing your issue. Also, I don’t know how your website is sending/receiving your GH definition so I guess it could be possible that it would be failing because of that… but I would need a little more information to be able to confirm.