algorithmic modeling for Rhino
What condition should I be checking for if I want to listen for a bake event? I.e. when the user decides to bake the geometry, which environment variable should I use to determine if the state is True/False? I need this to determine when to draw the geometry as Rhino GUIDs in the Rhino view port.
Tags:
In reference to the bake event watching, I've tried to do the following with my component (S.geometry is a list of GUIDs already present in Rhino but are hidden prior to this function) :
rhdoc = rc.RhinoDoc.ActiveDoc
def bakeShow(sender,e):
rs.ShowObjects(S.geometry)
ghenv.Component.PreviewExpired += preview
rhdoc.AddRhinoObject += bakeShow
My goal here is to override the built in Bake component and show the geometry I already have present (but which are hidden at this point) in the Rhino view port. What sort of commands or overriding would I need to do? Right now, the code above doesn't seem to do anything except the normal Bake behavior which is without attributes. I'm aware that EleFront is available but this particular component is meant to bake geometry without the use of other components.
Okay, fixed the problem. On a side note, is there a python/rhino scripting command or set of commands that lets me bake the geometry while retaining the attributes (i.e. color, object print widths)?
There has a lot of examples that you can take as a reference!
For the time being, I'll add subscribe and unsubscribe events to be safe.
So I should always include an unsubscribing line in my compiled components lest I leave it active and it continues to run in the background or hamper other commands?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by