I was trying to compile a simple component for my grasshopper, to make a subcurve and move the subcurve,the code was successful but when I change the crv input type hint to curve, the error below appears, I can only make the type hint as “ghdoc object when geometry”, but that will lead to the component in grasshopper show the name as “marshalling signal parameter” after compile, anyone know how to resolve the issue?
Thanks!
Error: Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid
Traceback:
line 890, in coerceguid, “C:\Users\Administrator\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 3717, in ReverseCurve, “C:\Users\Administrator\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py”
line 6, in msb, “”
line 13, in script
as I understand rhinoscriptsyntax, it does work with the GUID references instead of geometry. rhinoscriptsyntax is a library of python functions. If you want to work with the geometry directly,
use RhinoCommon. See the code below how it would look like if it is written in RhinoCommon:
That is greatly helpful!! Thank you for your solution , I’ll try learn to write in RhinoCommon, it looks easier to be perceived than rhinoscriptsyntax , however, anyone know what is the mistake of my previous code? I am still confused about receiving Error even when I change the input of crv to GUID… must be wrong with the code …
Here is the file, thank you, I found the situation goes wrong only when reverse is True, maybe something wrong with the line of rs.ReverseCurve(curve)?
Yes, that’s a solution but I was looking for a way not using ‘ghdoc’ option but using a ‘curve’ option and, what is making me confused is that it keeps Error when I use curve option, just cannot figure it out…
Well, rhinoscriptsyntax use GUID (huge number of characters) as inputs. If you change input to curve (geometry class) you must use Rhino.Geometry library (as I understand rhinoscriptsyntax). There is difference and combination of both “approaches” is not recommended.