generative modeling for Rhino
Hi,
First of all, I'm fairly new to grasshopper, have been messing around with it for almost two weeks and has already changed my workflow in quite a bit.
Before I started using GH, I had a brief experience writing Lisp routines for autocad. That sums up my scripting experience really.
I'd like to know if there is a way to get all objects from a layer in rhino and use them in GH. If I draw new geometry in that layer, the script "live updates" and that new geometry is automatically used in a GH definition.
For instance, let's say I have a circle and I draw cutting lines in the layer "Parcels". Those lines would cut the circle in diferent parcels withou me having to do the "set multiple geometries" routine everytime I feel like changing something.
I´ve found this script, but just can't manage to adapt it to the script in GH.
http://wiki.mcneel.com/developer/sdksamples/sellayer
Any thoughts? Is it even possible?
Thanks in advance.

Hi Rodrigo,
it's easy enough to harvest all geometry from a layer and it's easy enough to update Grasshopper when a referenced piece of geometry changes in Rhino. What is not particularly easy is detecting when a new object is added to a layer. You'd have to basically watch all object events and then update as soon as an object appears or disappears from a layer.
This request comes up quite a lot, I'll see if I can add a component specifically for this for the next release.
--
David Rutten
david@mcneel.com
Poprad, Slovakia

I added a Geometry Pipeline object that maintains a live feed of geometry from Rhino into Grasshopper. You can filter by type (point, curve, brep, mesh or any combination of the above), layer name (including wildcards) and object name (including wildcards).
I haven't been able to make it respond to layer name changes yet as there doesn't seem to be an event associated with those, but that will need some further scrutiny.
Geometry Pipeline will be available in the next release.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Rodrigo Líbano on November 30, 2011 at 5:32am Thanks for the quick reply, David.
I'm happy to hear the news. Keep up the great job.
Even if it doesn't respond to layer name changes, it'll be of great assistance.

Permalink Reply by Danny Boyes on November 30, 2011 at 7:58am In the image above is it one type only or can all four be selected?

Any combination can be selected.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by ryles on November 30, 2011 at 10:51am ooh nice, gotta ask now, any idea on release? ;-

Not sure, not too long I hope. I'm working on some optimizations and bug fixes so once I'm done with the easy ones I'll probably release. Few days if nothing goes terribly wrong.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by msgrom on January 4, 2012 at 11:24am Hello David,
Thanks for the update. I was wondering if it is at all possible to feed a list to either the Layer or the Name filters.
For example:
I wanted to move the geometry on layer 1 by 1 meter, the geometry on layer 2 by 2m and so on. There are a lot of layers and being able to input a series of strings would solve that problem.
Thanks in advance
M
Permalink Reply by Arpan Bakshi on April 20, 2012 at 3:15pm
Permalink Reply by Erick Katzenstein on November 29, 2011 at 1:27pm Rodrigo,
I put a definition together which is kind of a hack but works well for me when adding new objects to Rhino space without selecting in GH. Not live update, but uses a toggle.
To test, try adding new points to rhino space and then hit the boolean toggle. The object should be updated.
Requires Horster reference tools.
Also, I haven't been able to download the new GH yet, so this is made using the old one.
Added by David Stasiuk 8 Comments 22 Likes
Added by stefano 5 Comments 8 Likes
© 2013 Created by Scott Davidson.
Powered by