Grasshopper

algorithmic modeling for Rhino

aderror : iteration over non-sequence of type PolyCurve

HI

I am having a problem with the GHpython code below that reports the following error :

Runtime error (TypeErrorException): iteration over non-sequence of type PolyCurve, and points out to the line where yield stands

def littlestars():
    for i in [ i for i in range(len(median)) if i%2 ==0 ]:
        yield rs.MoveObject((ghcomp.Polygon(median[i], radius, sides, 0)[0]), -vect[i])

little = littlestars()

the problem appearently is with the rs.MoveObject, which according to some advices  should be expecting a string or a GUID, while what I've done here through the GHPython component is to feed it directly with inplace made polygons through

gh.polygon command

any suggestion on  how to tweek the argument to pass to the moveobject in a way that it returns its GUID instead is welcome

as by, I hope someone could help me find another way of creating polygons directly through the rhinocommon or rhinoscript syntax, in a way that  doesn't call a ghcomponent, and is still being a short algorithm

thanks

Views: 1275

Replies to This Discussion

Please upload your file?

there it is, thank u

Attachments:

Hi cristo

you need to convert polycurve to guid,Because MoveObject need a Guid,Check the attached file

Attachments:

thanks alot that pretty made the trick

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service