GH_RhinoScriptInterface
Plugin Interface object that is exposed via the RhinoScript layer.
Methods
AssignDataToParameter
#Find a parameter and assign some persistent data.
BakeDataInObject
#Find an object and bake all geometry inside of it.
Parameters:
| objectID (string) | Object InstanceID or name. |
Returns: An array of Rhino object IDs, or null on failure.
CloseAllDocuments
#Close all Grasshopper documents.
Returns: True on success, false on failure.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.CloseAllDocuments()
Set GH = Nothing
End SubCloseDocument
#Close the currently active Grasshopper document. If there is not active document, nothing will happen.
Returns: True on success, false on failure.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.CloseDocument()
Set GH = Nothing
End SubDisableBanner
#public void DisableBanner()
Disables the display of the Grasshopper banner during Component loading. The banner is typically only shown once during a Grasshopper session, namely when the Editor is first loaded.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.DisableBanner()
Call GH.ShowEditor()
Set GH = Nothing
End SubDisableSolver
#public void DisableSolver()
Disables the Grasshopper Solver. If the Solver is disabled, expired components and parameter will not be recomputed, though any existing solution will remain intact.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.DisableSolver()
Set GH = Nothing
End SubEnableBanner
#public void EnableBanner()
Enables the display of the Grasshopper banner during Component loading. The banner is typically only shown once during a Grasshopper session, namely when the Editor is first loaded.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.EnableBanner()
Call GH.ShowEditor()
Set GH = Nothing
End SubEnableSolver
#public void EnableSolver()
Enables the Grasshopper Solver. If the Solver is enabled, expired components and parameter will be recomputed.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.EnableSolver()
Set GH = Nothing
End SubHideEditor
#public void HideEditor()
Hide the main Grasshopper Editor. If the editor hasn't been loaded or if the Editor is already hidden, nothing will happen.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.HideEditor()
Set GH = Nothing
End SubIsEditorLoaded
#Returns the loaded state of the Grasshopper Main window.
Returns: True if the Main Grasshopper Window has been loaded.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call Rhino.Print("Grasshopper Editor Loaded: " & GH.IsEditorLoaded())
Set GH = Nothing
End SubIsEditorVisible
#Returns the visible state of the Grasshopper Main window.
Returns: True if the Main Grasshopper Window has been loaded and is visible.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call Rhino.Print("Grasshopper Editor Visible: " & GH.IsEditorVisible())
Set GH = Nothing
End SubIsSolverEnabled
#Returns the state of the Grasshopper Solver.
Returns: True if the Grasshopper Solver is enabled.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call Rhino.Print("Grasshopper Solver Enabled: " & GH.IsSolverEnabled())
Set GH = Nothing
End SubLoadEditor
#public void LoadEditor()
Load the main Grasshopper Editor. If the editor has already been loaded nothing will happen.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.LoadEditor()
Set GH = Nothing
End SubOpenDocument
#Open a Grasshopper document. The editor will be loaded if necessary, but it will not be automatically shown.
Parameters:
| filename (string) | Path of file to open (must be a *.gh or *.ghx extension). |
Returns: True on success, false on failure.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.OpenDocument("C:\ExampleFile.ghx")
Set GH = Nothing
End SubRunAsCommand
#obsoletePlease use RunInCommandContext
Parameters:
| ghDoc (GH_Document) | |
| command (Command) | |
| rhinoDoc (RhinoDoc) | |
| mode (RunMode) |
RunHeadless
#public void RunHeadless()
RunInCommandContext
#public Result RunInCommandContext(GH_Document ghDoc, Command command, RhinoDoc rhinoDoc, RunMode mode)
Parameters:
| ghDoc (GH_Document) | |
| command (Command) | |
| rhinoDoc (RhinoDoc) | |
| mode (RunMode) |
RunSolver
#Runs the solver once, even if the global solver lock is on.
Parameters:
| expireAllObjects (bool) | If true, will expire all objects in the current document. |
SaveDocument
#Save the currently active Grasshopper document. If the active document has never been saved, a Save... dialog will be shown. If there is no active document, nothing will happen.
Returns: True on success, false on failure.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.SaveDocument()
Set GH = Nothing
End SubSaveDocumentAs
#Save the currently active Grasshopper document in a specific location. If there is no active document, nothing will happen.
Parameters:
| filename (string) | Path of file to save to (must be a *.gh or *ghx extension). |
Returns: True on success, false on failure.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.SaveDocumentAs("C:\GrasshopperBackup\[" & Hour(Now()) & "][" & Minute(Now()) & "][" & Second(Now()) & "].ghx")
Set GH = Nothing
End SubSetSliderRangeAndValue
#Find a slider and assign a new value.
SetSliderValue
#Find a slider and assign a new value.
ShowEditor
#public void ShowEditor()
Show the main Grasshopper Editor. The editor will be loaded first if needed. If the Editor is already on screen, nothing will happen.
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.ShowEditor()
Set GH = Nothing
End Sub