Grasshopper

algorithmic modeling for Rhino

This is more of a Python scripting question as I am not working in the Grasshopper environment but I thought that someone on this forum might know the answer.

I have a script(part of which follows) :

rs.AddLayer("TEMP FRIT")
rs.CurrentLayer("TEMP FRIT")
for i in range(0,num_of_frit_types):
     temp_block = rs.InsertBlock(block_names[i],[-1000,-1000,0])
     temp_surfaces = rs.ExplodeBlockInstance(temp_block)
     temp_area = 0
     for item in temp_surfaces:
         rs.ObjectLayer(item,"TEMP_FRIT")
         temp_area += rs.SurfaceArea(item)[0]
     frit_percent_dict[block_names[i]] = temp_area

 

It creates a new layer "TEMP FRIT" but does not place the item on the layer and I get this error message. 

Message: TEMP_FRIT does not exist in LayerTable

Thanks

Jon

Views: 643

Replies to This Discussion

Hi Jon,

you used an underscore while assigning the layer, should be:

rs.ObjectLayer(item,"TEMP FRIT")

Well that's embarrassing!

Thanks. 

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