generative modeling for Rhino
Hi Forum, Hi Giulio, Hi David,
Thank you for all your explanations,
Apartir of this post, I inaugurate a new post regarding access to a grasshopper definition for an interface or a VB plugin rhp.
I developed under Visual Studio 2010 interface that communicates with an XML file.
I have a grasshopper in gha component that reads the xml file and assigns a value list to a grasshopper definition, which in this case is under a bridge.
But the goal is to develop and validate this access then that definition will always have easy access to a rhp with sends control and selection of object through the interface rhinoceros.
Here is an overview of the interface:
There is a project manager to manage the xml files that constitute the parameters of departures.
Regarding the interface is the communication parameters with grasshopper, no worries and no problems encountered.
Then access to selections of objects and users in the game rhinoceros.
From the model giulio to create a plugin in rhinoceros 5.0, I decided to create a menu command to interact inside rhino.
To validate this step and familiar with the RGB, with the help of David I of written piece of code that opens a grasshopper definition and assign parameters to the definition:
Call Main ()
Sub Main ()
Set wshShell = CreateObject("wscript.shell")
'Execution du fichier
'Exemple - ouverture d'un fichierprogramme
Set oExec = WshShell.Exec("C:\Program Files\Rhinoceros 4.0\Plug-ins\RhinoDeveloppements\RhinoBridges\Interface\Gestion\Definition\RhinoBridges.exe")
'Script RhinoBridges.V1.0 Ponts cadres
'Script version Friday, 26 May 2011 20:22:00
Rhino.command ("-Grasshopper _Editor _Hide _Enter")
Rhino.command ("-Grasshopper _Solver _Enable _Enter")
Sub Main2 ()
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.OpenDocument("C:\Documents and Settings\rémy\Mes documents\RHINOCEROS\Developpements\RhinoBridges\ghx\Pont Cadre\PCRi.gh")
curve = Rhino.GetObjects("Selectionné une courbe", 0)
If (IsNull(curve)) Then Exit sub
pt = Rhino.GetObjects("Selectionné un point", 0)
If (IsNull(pt)) Then Exit sub
Call gh.AssignDataToParameter("Curve Input", curve)
Call gh.AssignDataToParameter("Pt input", pt)
I must have a code comprising ten assigndataparameter.
I now want to turn these codes rvb in VS2010 solution and this complicates its severity.
if I understand this correctly I think you are asking how to run Grasshopper from another plug-in in the same Rhino instance. Is that so?
If it is, I think you are after the
method call. This finds the currently open Grasshopper plugin and gives the RhinoScript object.
I've modified the code that I passed on to you before for a larger sample.
I hope this helps,
Thanks for your reply, I Updated my position compared to what you gave me, but still nothing happens.
I run yet grasshopper and then the definition is not open.
Sorry, don't worked For the time
I've sent you a PM. It might be something simple. On Monday we can look at this together. Let's investigate and see if there is something we can find.
I demand a standard script.
I would cook rhinoceros following elements in a boolean.
I wrote this code, but apparently I have trouble with the array.
Dim arrItems, arrDefaults, arrResults, blnVal
arrItems = Array("Points", "Off", "On", _
"Courbes", "Off", "On")
arrDefaults = array(False, False)
arrResults = Rhino.GetBoolean("Accepter les géométries", arrItems, arrDefaults)
If IsArray(arrResults) Then
For Each blnVal In arrResults
If Array(True, True) Then
Call gh.BakeDataInObject("Pt 3D Output")
Call gh.BakeDataInObject("Crv 3D Output")
Let's see what we find when we look at this together.
Ok thanks thanks thanks,
I feel that I will reach the goal, then I have over 25 functions to adapt.
The rvb help me but I find myself developing block to pass hard.