GH_CustomButton

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

Properties

Description

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

Icon

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

Name

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

RequireCode

#
public string RequireCode { get; set; }
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

RequireCodeInstance

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

RequireDocument

#
public bool RequireDocument { get; set; }
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.

RequireObjects

#
public bool RequireObjects { get; set; }
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.

RequireSelection

#
public bool RequireSelection { get; set; }
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.

RunCode

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

RunCodeInstance

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

UseCustomRequirementCode

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

Methods

Read

#
public bool Read(GH_IReader reader)
reader (GH_IReader)
Read

Write

#
public bool Write(GH_IWriter writer)
writer (GH_IWriter)
Write