algorithmic modeling for Rhino
Hi Max
good discussion but... do you need exactly this in Grasshopper?
This won't be as easy as writing the script from the other window (from the EditPythonScript editor). The reason is that when a GhPython component is computing, it might well be that the other part is not computed yet. If you need to bake in GH, I would suggest that you use one of the baking components (also in script) that exist out there.
Please let me know if they would not work for you.
Thanks
Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com
http://www.food4rhino.com/project/selectablepreview?etx
It has other purpose than baking and it appears to be in C# though.
What's 'dynamic' in this context?
If you mean to delete the previous outcome of the iteration, that is also possible to do also in a script. I am not sure if there is a pre-made component for that, but it would be possible also from there.
Let's see what Max needed before speculating.
import Rhino as rh
from System.Collections.Generic import *
from System import *
ghdoc = ghenv.Component.Attributes.Owner.OnPingDocument()
rhdoc = rh.RhinoDoc.ActiveDoc
componentsToBake = [x for x in ghdoc.ActiveObjects() if x.Name == "Mesh Sphere"]
for component in componentsToBake:
ids = List[Guid]()
component.BakeGeometry(rhdoc,ids)
Change "Mesh Sphere" in the above to find the component you're looking to bake. As Giulio points out, there is no guarantee that the object in question has finished solving, since this script is executed during a solution - so use w/ caution.
Please... add a big warning at the beginning of the script.
Otherwise, later someone will get bitten.
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by