algorithmic 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:
Option Explicit
Call Main ()
Sub Main ()Dim wshShell
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")
End Sub'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 ()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.OpenDocument("C:\Documents and Settings\rémy\Mes documents\RHINOCEROS\Developpements\RhinoBridges\ghx\Pont Cadre\PCRi.gh")Dim curve
curve = Rhino.GetObjects("Selectionné une courbe", 0)
If (IsNull(curve)) Then Exit subDim pt
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)
Call gh.RunSolver(True)
End Sub
I must have a code comprising ten assigndataparameter.
I now want to turn these codes rvb in VS2010 solution and this complicates its severity.
On this post I explain the problems first: http://www.grasshopper3d.com/forum/topics/assign-data-parameter-in-...
and
http://www.grasshopper3d.com/forum/topics/how-can-i-use-grasshoper-...
Thanks...
Tags:
Hello again,
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
RhinoApp.GetPlugInObject("b45a29b1-4343-4035-989e-044e8580d9cf")
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,
- Giulio
________________
giulio@mcneel.com
Giulio,
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.
Thanks,
- Giulio
_______________
giulio@mcneel.com
Giulio,
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
Rhino.Print blnVal
Next
End If
If Array(True, True) Then
Call gh.BakeDataInObject("Pt 3D Output")
Call gh.BakeDataInObject("Crv 3D Output")
End If
Thanks
Let's see what we find when we look at this together.
Thanks,
- Giulio
_______________
giulio@mcneel.com
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.
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