Hi,
I am trying to check the way rhinoscriptsyntax MoveObject() method works. When trying to implement it into the Rhino Python Editor, it works with no problem:
import rhinoscriptsyntax as rs
curve = rs.GetObject("pick up the curve")
rs.MoveObject(curve,[10,0,0])
But when I try to do the same thing in the GH Python component, like this:
import rhinoscriptsyntax as rs
a = rs.MoveObject(curve,[10,0,0])
(“curve” is the GH Python’s input plug)
Here is the error message I get:
Runtime error (TypeErrorException): iteration over non-sequence of type NurbsCurve
Traceback:
line 1076, in TransformObjects, “C:\Documents and Settings\Administrator\Application Data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py”
line 392, in MoveObjects, “C:\Documents and Settings\Administrator\Application Data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py”
line 378, in MoveObject, “C:\Documents and Settings\Administrator\Application Data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py”
line 3, in script
Why is that?
Thank you.
P.S.
I saw this “Iteration over non-sequence of type NurbsCurve” issue has appeared in two more cases by googling. Two separated users posted a question on this at stackoverflow.com, but unfortunately I did not understand the answers.
It looks like the curve variable is a String or Guid with the unique ID of the curve in the first example, and the actual NurbsCurve in the second example, rather than the ID of the curve.
Thank you Steve! Worked like a charm.
The type for the “curve” input was “Curve”. When I changed it back to “ghDoc object” it worked. Could you tell me when do I need to leave the hint as “ghDoc object” and when do I need to set it to “Curve, Mesh, Surface…”?
Ok. And this applies to number sliders (integer, float) plugged to GH Python component too (leaving them with “ghDoc” type)? Or just to geometry objects (curves, points, meshes, surfaces…)?