generative modeling for Rhino
Tags:

Permalink Reply by Tijl Uijtenhaak on December 2, 2010 at 4:40am
Permalink Reply by Giulio Piacentino on December 2, 2010 at 5:46am
Permalink Reply by Tijl Uijtenhaak on December 2, 2010 at 3:10pm 
Permalink Reply by Tijl Uijtenhaak on December 3, 2010 at 3:07am
Permalink Reply by Kirk Martini on April 1, 2011 at 6:10am I've been looking for a solution to this on the forum: controlling a grasshopper model using C# in a VS studio project. This post is the closest I have found. Can you tell me how to go about this? I have discovered, as noted above, that you can't update sliders while you're inside a solution.
Thanks,
Kirk Martini
Permalink Reply by Giulio Piacentino on April 5, 2011 at 10:09am Hi Kirk,
how is this development going? If you still need some help, could you please start a new discussion? (this one is a bit old)
Thanks,
- Giulio
__________________
giulio@mcneel.com
McNeel Europe
Permalink Reply by Giulio Piacentino on December 1, 2010 at 10:10am import clr
clr.AddReferenceByName("Grasshopper")
import System
import Rhino
import Grasshopper
from Rhino import RhinoApp, RhinoDoc
from Rhino.Geometry import *
gh = RhinoApp.GetPlugInObject("Grasshopper")
gh.LoadEditor()
gh.CloseAllDocuments()
gh.ShowEditor()
gh.OpenDocument("C:\\Users\\Giulio\\Desktop\\test.ghx")
docServer = Grasshopper.GH_InstanceServer.DocumentServer
doc = docServer[0] # first opened document
def FindBatteryByNickname(docObjects, name):
if docObjects is None: return None
for obj in docObjects:
attr = obj.Attributes
if attr.PathName == name:
return obj
raise Exception(name + " was not found in document")
param = FindBatteryByNickname(doc.Objects, "myBegin")
if not (param is None):
param.ClearPersistentData()
newCircle = Circle(Point3d(1,11,111), 32)
param.AddPersistentData(newCircle) # you must add the right type here!
param.ExpireSolution(True) # recomputes the whole solution
param = FindBatteryByNickname(doc.Objects, "myResult")
if not (param is None):
ghCircles = param.VolatileData # access persistent data as a tree
ghCircle = ghCircles[0][0] # a list of all grasshopper-types
#circle = ghCircle.Value # access the "real" circle
rhinoDoc = RhinoDoc.ActiveDoc
ghCircle.BakeGeometry(rhinoDoc, rhinoDoc.CreateDefaultAttributes(), System.Guid())
Permalink Reply by Tijl Uijtenhaak on December 2, 2010 at 5:06am
Permalink Reply by Giulio Piacentino on December 2, 2010 at 5:13am
Permalink Reply by Tijl Uijtenhaak on December 2, 2010 at 5:20am Added by David Stasiuk 8 Comments 24 Likes
Added by stefano 5 Comments 8 Likes
© 2013 Created by Scott Davidson.
Powered by