Grasshopper

algorithmic modeling for Rhino

Runtime error (ArgumentTypeException): expected IEnumerable[Point3d], got list

Hello there,

I am new with Python and i am trying to test a code in ghpython component and get this error:

Runtime error (ArgumentTypeException): expected IEnumerable[Point3d], got list
Traceback:
  line 114, in AddCurve, "C:\Documents and Settings\Panos\Application Data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py"
  line 91, in script

line 91: newcurve = rs.AddCurve(arrNewPos,Rebuild)

Is there any possible idea for what is going wrong?

Any help would be greatly appreciated.

Views: 3251

Replies to This Discussion

Hi Panos,

I think it might have to do with the content of the list, but could you please post a Grasshopper file with a sample?

Thanks,

- Giulio
________________
giulio@mcneel.com

Here are the files.

Thank you!

Attachments:

Hi Panos,

there were two problems in the code - I hope I fixed them.

  1. Rebuild was a list of floating point numbers, not a single integer.
  2. Use rhinosciptsyntax marshalling if you use rs.DeleteObject(id). Otherwise, the input will be pure RhinoCommon geometry objects, and not ids in scriptcontext.doc.Objects. You can use print(type(obj)) to see the type of an instance.

Cheers,

- Giulio
________________
giulio@mcneel.com

Attachments:

Hello Gulio,

It is working great!! I can't thank you enough!

I had a notion that the rebuild parameter was wrong but i couldn't fix it on my own!

Thank you!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service