Grasshopper

algorithmic modeling for Rhino

Hello!

I am currently trying to render animation with python, but "1. Solution exception:len() of unsized object" has just occured. It is related to geo but there are lots of geometries maybe this is the problem ?

Thank you!

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

if active:

for i in range(len(geo)):

geo_id = geo[i]

sc.doc = ghdoc

doc_object = rs.coercerhinoobject(geo_id)

geometry = doc_object.Geometry
attributes = doc_object.Attributes

sc.doc = Rhino.RhinoDoc.ActiveDoc

rhino_ref = sc.doc.Objects.Add(geometry,attributes)

rs.ObjectLayer(rhino_ref, layer)

C = True

else:
C = False

***********************

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

line 7, in script





 



Views: 1453

Attachments:

Replies to This Discussion

right click your geo input-head and change the type from item to list ....  then it works :)

Attachments:

Thank you very much! 

it works very well thank you again!

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