GH_CustomButton

The GH_CustomButton class maintains all information needed for user-defined UI buttons.

Properties

Description

#
Gets or sets the description for this button. The description is typically used in the tooltip.
public string Description { get; set; }

Icon

#
Gets or sets the icon for this button. The icon should be 24x24 pixels.
public Bitmap Icon { get; set; }

Name

#
Gets or sets the name of the Custom Button.
public string Name { get; set; }

RequireCode

#
Gets or sets the requirement filter code for this button. The RequireCode must be a compilable VB.NET class that inherits from Grasshopper.GUI.GH_CustomButtonRequireFilter
public string RequireCode { get; set; }

RequireCodeInstance

#
Gets the cached RequireCode instance. If there is no instance yet, it will be compiled.
public GH_CustomButtonRequireFilter RequireCodeInstance { get; }

RequireDocument

#
Gets or sets whether the button requires a document to exist before it will be enabled. This property is only used when the UseCustomRequirementCode property is set to False.
public bool RequireDocument { get; set; }

RequireObjects

#
Gets or sets whether the button requires at least one object to exist before it will be enabled. This property is only used when the UseCustomRequirementCode property is set to False.
public bool RequireObjects { get; set; }

RequireSelection

#
Gets or sets whether the button requires at least one object to be selected before it will be enabled. This property is only used when the UseCustomRequirementCode property is set to False.
public bool RequireSelection { get; set; }

RunCode

#
Gets or sets the runcode for this button. The runcode must be a compilable VB.NET class that inherits from Grasshopper.GUI.GH_CustomButtonRunCode
public string RunCode { get; set; }

RunCodeInstance

#
Gets the cached RunCode instance. If there is no runcode instance yet, it will be compiled.
public GH_CustomButtonRunCode RunCodeInstance { get; }

UseCustomRequirementCode

#
Gets or sets whether the custom requirement code should be used.
public bool UseCustomRequirementCode { get; set; }

Methods

Read

#
public bool Read(
reader
)
Read

Write

#
public bool Write(
writer
)
Write