GH_RhinoScriptInterface
Plugin Interface object that is exposed via the RhinoScript layer.
Methods
AssignDataToParameter
#Find a parameter and assign some persistent data.
Returns: True on success, false on failure.
BakeDataInObject
#Find an object and bake all geometry inside of it.
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
#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.
public void DisableBanner()
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.DisableBanner()
Call GH.ShowEditor()
Set GH = Nothing
End SubDisableSolver
#Disables the Grasshopper Solver. If the Solver is disabled, expired components and parameter will not be recomputed, though any existing solution will remain intact.
public void DisableSolver()
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.DisableSolver()
Set GH = Nothing
End SubEnableBanner
#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.
public void EnableBanner()
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.EnableBanner()
Call GH.ShowEditor()
Set GH = Nothing
End SubEnableSolver
#Enables the Grasshopper Solver. If the Solver is enabled, expired components and parameter will be recomputed.
public void EnableSolver()
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.EnableSolver()
Set GH = Nothing
End SubHideEditor
#Hide the main Grasshopper Editor. If the editor hasn't been loaded or if the Editor is already hidden, nothing will happen.
public void HideEditor()
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
#Load the main Grasshopper Editor. If the editor has already been loaded nothing will happen.
public void LoadEditor()
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.
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 SubRunHeadless
#public void RunHeadless()
RunInCommandContext
#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.
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.
Returns: True on success, false on failure.
ShowEditor
#Show the main Grasshopper Editor. The editor will be loaded first if needed. If the Editor is already on screen, nothing will happen.
public void ShowEditor()
Example:
Call GrasshopperExampleScript()
Sub GrasshopperExampleScript()
Dim GH
Set GH = Rhino.GetPlugInObject("Grasshopper")
Call GH.ShowEditor()
Set GH = Nothing
End Sub