Grasshopper

algorithmic modeling for Rhino

Use ObjectsByLayer() in python script to output geometries in layers as grasshopper object

Hello,

I'm trying to write a python script to output the geometries by chosen layers like follows but it just gives me <null> object as an output. Is there any way to do this?

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
sc.doc = Rhino.RhinoDoc.ActiveDoc

objs = rs.ObjectsByLayer(LAYER)

a = objs

thank you,

Views: 1696

Attachments:

Replies to This Discussion

Hi Junichiro, check out the attached file. You'll probably want to look up the "coerce" functions in the RhinoScriptsyntax documentation if you want to learn more about how to deal with GUIDs coming from the Rhino document. Hope that helps..

Attachments:

Hi Anders,

thank you very much for your file! it worked great. I wasn't aware of this "coerce" functions.

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