Grasshopper

algorithmic modeling for Rhino

Python error with rebuild curves: len() of unsized object!?

Hey,

I'm currently experimenting with Python, grasshopper and point attractors, but I'm stuck with a script error produced by the following line:

for i in range(len(Curves)):
   AttractorPtsList.append(AttractorPts[i])

Runtime error (TypeErrorException): len() of unsized object

AttractorPts is a variable that is filled with an external list of points, with a type hint of "Point3D".
Curves is an external list of curves, first rebuild (ReB; Degree 1, Count 16) and then input with a type hint of "Curve", which in my mind produces the script error?

I can't figure out a workaround though. Any ideas?

Views: 1334

Replies to This Discussion

Hi Marc,

You probably have your "Curves" input set to "Item access" instead of "List access".
Please attach your files for any further issues.

The "Curves" input was automatically set to "Item Access".
Also changing it to "List Access" didn't do any good.

Thanks for your help so far.
I've attached the files.

Attachments:

Hi Marc,

I just checked your file. You need to set both the AttractorPts and the Curves to List Access. Once you do that the scripts works fine.

Thanks you! It worked perfectly. :)

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service