Constructors

GH_CustomPreviewComponent

#
public GH_CustomPreviewComponent()

Fields

m_attributes

protected IGH_Attributes m_attributes
inherited fromGH_DocumentObject

Properties

Attributes

public IGH_Attributes Attributes { get; set; }
Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
inherited fromGH_DocumentObject
Attributes

Category

public virtual string Category { get; set; }
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
inherited fromGH_InstanceDescription
Category

ClippingBox

#
public override BoundingBox ClippingBox { get; }

ComponentGuid

#
public override Guid ComponentGuid { get; }

DataComparison

[EditorBrowsable(EditorBrowsableState.Never)] public GH_DataComparison DataComparison { get; set; }
Gets or sets the data matching algorithm for this component
inherited fromGH_Component
DataComparison

Description

public virtual string Description { get; set; }
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
inherited fromGH_InstanceDescription
Description

DisplayItems

#
public IEnumerable<GH_CustomPreviewItem> DisplayItems { get; }
Iterate over all the custom display items in this component.

Exposure

#
public override GH_Exposure Exposure { get; }

HasCategory

public bool HasCategory { get; }
Gets whether or not the Category field has been set.
inherited fromGH_InstanceDescription
HasCategory

HasSubCategory

public bool HasSubCategory { get; }
Gets whether or not the SubCategory field has been set.
inherited fromGH_InstanceDescription
HasSubCategory

HelpDescription

protected virtual string HelpDescription { get; }
Override this method if you want the help topic content to be more than the Component description.
inherited fromGH_Component

Hidden

public bool Hidden { get; set; }
Gets or sets the hidden flag for this component. Does not affect Hidden flags on parameters associated with this component.
inherited fromGH_Component
Hidden

Icon

#
protected override Bitmap Icon { get; }

Icon_24x24

public Bitmap Icon_24x24 { get; }
The icon associated with this object.
inherited fromGH_DocumentObject
Icon_24x24

Icon_24x24_Locked

public Bitmap Icon_24x24_Locked { get; }
The greyscale icon of this object.
inherited fromGH_DocumentObject
Icon_24x24_Locked

IconCapableUI

public virtual bool IconCapableUI { get; }
By default the NickName menu item supports the Icon Mode override toggle. If your UI is not capable of displaying icons, then override this property and return False.
inherited fromGH_ActiveObject

IconDisplayMode

public GH_IconDisplayMode IconDisplayMode { get; set; }
Gets the current display mode of the object.
inherited fromGH_DocumentObject
IconDisplayMode

IncludeInRender

#
public bool IncludeInRender { get; set; }
Gets or sets whether the custom geometry inside this component ought to be included in a render pipeline.

InConstructor

public bool InConstructor { get; }
Gets the constructor flag for this instance. If InConstructor = True, it means the component is still registering parameters and the layout is not yet complete.
inherited fromGH_Component
InConstructor

InstanceDescription

public override string InstanceDescription { get; }
inherited fromGH_Component

InstanceGuid

public Guid InstanceGuid { get; }
Gets the ID of this runtime instance.
inherited fromGH_InstanceDescription
InstanceGuid

Internal_Icon_24x24

[EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false)] protected virtual Bitmap Internal_Icon_24x24 { get; }
Override this function to supply a custom icon. The result of this property is cached, so don't worry if icon retrieval is not very fast.
inherited fromGH_DocumentObject

IsBakeCapable

#
public override bool IsBakeCapable { get; }

IsDataProvider

public sealed override bool IsDataProvider { get; }
Components are never Data providers. Only the output parameters can be considered to be providers.
inherited fromGH_Component

IsPreviewCapable

public virtual bool IsPreviewCapable { get; }
If a single parameter is PreviewCapable, so is the component. Override this property if you need special Preview flags.
inherited fromGH_Component
IsPreviewCapable

IsValidPrincipalParameterIndex

public bool IsValidPrincipalParameterIndex { get; }
Gets whether the MasterParameterIndex property identifies a valid parameter.
inherited fromGH_Component

Keywords

public virtual IEnumerable<string> Keywords { get; }
Gets a list of additional keywords that describe the object. Typically this list is empty but you can override this property to aid in object searches.
inherited fromGH_InstanceDescription
Keywords

Locked

public override bool Locked { get; set; }
Gets or sets the Locked state for this Component. This also sets locked states for all input and output parameters.
inherited fromGH_Component

Message

public string Message { get; set; }
Gets or sets a custom message to be displayed underneath the component. This message is not serialized and should be assigned on every solution anew.
inherited fromGH_Component
Message

MutableNickName

public bool MutableNickName { get; set; }
Gets or sets a value that enables Nick name changes through the menu. The default is TRUE.
inherited fromGH_ActiveObject
MutableNickName

Name

public virtual string Name { get; set; }
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
inherited fromGH_InstanceDescription
Name

NickName

public virtual string NickName { get; set; }
Gets or sets the nickname of the object. This field can be changed by the user.
inherited fromGH_InstanceDescription
NickName

Obsolete

public virtual bool Obsolete { get; }
Gets whether this object is obsolete. Default implementation returns true if the class name contains the string "OBSOLETE" or if this class has been decorated with the ObsoleteAttribute. You are free to override this if you want, but I suggest adding the ObsoleteAttribute instead.
inherited fromGH_DocumentObject
Obsolete

Params

public GH_ComponentParamServer Params { get; }
Gets the parameter manager object for this component.
inherited fromGH_Component
Params

Phase

public GH_SolutionPhase Phase { get; set; }
Gets or sets the solution phase this object is currenly in.
inherited fromGH_ActiveObject
Phase

PrincipalParameterIndex

public int PrincipalParameterIndex { get; set; }
Gets or sets the principal parameter index override. Negative indices or indices larger than or equal to the input parameter count will be ignored and regular principal parameter detection will kick in.
inherited fromGH_Component

ProcessorTime

public override TimeSpan ProcessorTime { get; }
Gets the total processor time (profiler) spend by this component and all input parameters.
inherited fromGH_Component

RunCount

public int RunCount { get; }
Gets a value indicating how many times the SolveInstance method was called on this component during the last solution. This property will return -1 if no valid runcount is available.
inherited fromGH_Component
RunCount

RuntimeMessageLevel

public sealed override GH_RuntimeMessageLevel RuntimeMessageLevel { get; }
Returns the worst case runtime warning level of me and all my parameters
inherited fromGH_Component

SubCategory

public virtual string SubCategory { get; set; }
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
inherited fromGH_InstanceDescription
SubCategory

ViewportFilter

#
public string ViewportFilter { get; set; }
Gets or sets a string filter (supporting wildcards) that limits whether geometry is drawn in a specific viewport.

Methods

AddedToDocument

public override void AddedToDocument(GH_Document document)
Overrides the AddedToDocument method and delegates the call to all parameters.
inherited fromGH_Component
document (GH_Document)Document that now owns this object.

AddRuntimeMessage

public virtual void AddRuntimeMessage(GH_RuntimeMessageLevel level, string text)
Add a new message to this object. Valid message type flags are Warning and Error. If the Message string is empty or zero-length no message is added.
inherited fromGH_ActiveObject
level (GH_RuntimeMessageLevel)Type of message. Only Warnings and Errors are recorded.
text (string)Content of message.
AddRuntimeMessage

AfterSolveInstance

protected virtual void AfterSolveInstance()
Override this method if you want to be called after the last call to SolveInstance.
inherited fromGH_Component

AppendAdditionalComponentMenuItems

#
protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)

AppendAdditionalMenuItems

public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
Adds typical component type items to the context menu:
  1. Data comparison types
  2. Custom (overridden) items
  3. Nested input parameter context menu items
  4. Nested output parameter context menu items
inherited fromGH_Component

AppendMenuItems

public override bool AppendMenuItems(ToolStripDropDown menu)
This function is called when a context menu is about to be displayed. Override it to set custom items. GH_ActiveObject will already populate the menu with default items, if you merely wish to insert object-specific menu item, consider overriding AppendAdditionalMenuItems instead.
inherited fromGH_ActiveObject
menu (ToolStripDropDown)Menu object to populate.
If true, the menu will be displayed, if false the menu will be supressed.

AppendRenderGeometry

#
public override void AppendRenderGeometry(GH_RenderArgs args)

AssignInitCodeToInputParameter

protected bool AssignInitCodeToInputParameter(int paramIndex, string code)
Utility function for parsing and assigning init codes. This only works for standard parameter types.
inherited fromGH_Component
paramIndex (int)Index of input parameter to assign.
code (string)Code to parse and assign.
True if the code was assigned, false if otherwise.

BakeGeometry

public virtual void BakeGeometry(RhinoDoc doc, List<Guid> obj_ids)
inherited fromGH_Component
doc (RhinoDoc)
obj_ids (List<Guid>)
BakeGeometry

BakeGeometry

#
public override void BakeGeometry(RhinoDoc doc, ObjectAttributes att, List<Guid> objectIds)
doc (RhinoDoc)
att (ObjectAttributes)
objectIds (List<Guid>)

BeforeSolveInstance

#
protected override void BeforeSolveInstance()
Override this method if you want to be called before the first call to SolveInstance.

ClearData

#
public override void ClearData()

ClearRuntimeMessages

public sealed override void ClearRuntimeMessages()
Clears all runtime messages in me and my parameters
inherited fromGH_Component

CollectData

public override void CollectData()
Calls CollectData on all input parameters and makes sure the Component and all associated parameters are left in a valid state.
inherited fromGH_Component

ComputeData

public override void ComputeData()
Compute all data and fill out all output parameters.
inherited fromGH_Component

CopyFrom

public void CopyFrom(IGH_InstanceDescription other)
Copy all fields (except the instance ID) from another instance description.
inherited fromGH_InstanceDescription
other (IGH_InstanceDescription)Object to mimic.

CreateAttributes

public override void CreateAttributes()
Create new attributes.
inherited fromGH_Component
Remarks: Typically you do not have to override this.

DependsOn

public sealed override bool DependsOn(IGH_ActiveObject potentialSource)
Returns True is any one of my input parameters depends on the source.
inherited fromGH_Component
potentialSource (IGH_ActiveObject)Source to test for dependency.

DestroyIconCache

protected void DestroyIconCache()
Call this method to erase the existing icon cache. You must call this if you want to change the display icon of an object.
inherited fromGH_DocumentObject

DocumentContextChanged

public override void DocumentContextChanged(GH_Document document, GH_DocumentContext context)
Overrides the DocumentContextChanged method and delegates the call to all parameters.
inherited fromGH_Component
document (GH_Document)Document that owns this object.
context (GH_DocumentContext)The reason for this event.

DrawViewportMeshes

#
public override void DrawViewportMeshes(IGH_PreviewArgs args)

DrawViewportWires

#
public override void DrawViewportWires(IGH_PreviewArgs args)

ExpireDownStreamObjects

protected override void ExpireDownStreamObjects()
Expire all objects that depend on any of the output parameters.
inherited fromGH_Component

ExpirePreview

public virtual void ExpirePreview(bool redraw)
Call this function when you suspect that the preview has expired for this object. This will cause the display cache to be eradicated.
inherited fromGH_DocumentObject
redraw (bool)
ExpirePreview

ExpireSolution

public override void ExpireSolution(bool recompute)
Informs the document that owns this object that the solution has expired. The current object will be set to BLANK as a result. This method is recursive, it will also expire any and all objects which depend on this object. If you want a less destructive expiration, consider using ClearData(). If this object is already Blank, you should consider not expiring it.
inherited fromGH_ActiveObject
recompute (bool)If True, the document will be instructed to solve the new state.

GenerateDefaultHTML

protected GH_HtmlFormatter GenerateDefaultHTML()
Creates the default component help topic, including all parameter lists.
inherited fromGH_Component
Remarks: This formatter does not include the this-is-an-autogenerated-topic message

GenerateParameterHelp

protected string GenerateParameterHelp()
Create an HTML string that lists names and descriptions for input and output parameters.
inherited fromGH_Component

GenerateParameterHelp

protected string GenerateParameterHelp(IGH_Param param)
Generate HTML string for a single parameter.
inherited fromGH_Component
param (IGH_Param)

GetValue

protected bool GetValue(string valueName, bool default)
Get a boolean value from the component value table.
inherited fromGH_DocumentObject
valueName (string)Name of boolean to retrieve.
default (bool)Default value to return in case of missing named value.
The boolean value with the given name of the default value.

GetValue

protected Color GetValue(string valueName, Color default)
Get a color value from the component value table.
inherited fromGH_DocumentObject
valueName (string)Name of color to retrieve.
default (Color)Default value to return in case of missing named value.
The color value with the given name of the default value.

GetValue

protected double GetValue(string valueName, double default)
Get a double value from the component value table.
inherited fromGH_DocumentObject
valueName (string)Name of double to retrieve.
default (double)Default value to return in case of missing named value.
The double value with the given name of the default value.

GetValue

protected int GetValue(string valueName, int default)
Get an integer value from the component value table.
inherited fromGH_DocumentObject
valueName (string)Name of integer to retrieve.
default (int)Default value to return in case of missing named value.
The integer value with the given name of the default value.

GetValue

protected string GetValue(string valueName, string default)
Get a string value from the component value table.
inherited fromGH_DocumentObject
valueName (string)Name of string to retrieve.
default (string)Default value to return in case of missing named value.
The string value with the given name of the default value.

HtmlHelp_Source

protected internal override string HtmlHelp_Source()
Return a String which contains HTML formatted source for the help topic. If you want to pass a URL that points to a remote page, then prefix the URL with a GOTO: tag, like so: GOTO:http://www.YourWebAddressHere.com
inherited fromGH_Component
Remarks: You can use the GUI.GH_HtmlFormatter class to generate an HTML page which conforms to Grasshopper Help standards
The HTML default help topic for this component including all parameters
Explicit

IGH_PreviewObject.InternalDrawViewportMeshes

#
void InternalDrawViewportMeshes(IGH_PreviewArgs args)
args (IGH_PreviewArgs)
DrawViewportMeshes
Explicit

IGH_PreviewObject.InternalDrawViewportWires

#
void InternalDrawViewportWires(IGH_PreviewArgs args)
args (IGH_PreviewArgs)
DrawViewportWires

IsolateObject

public override void IsolateObject()
Sever the connections of all input and output parameters.
inherited fromGH_Component

MovedBetweenDocuments

public override void MovedBetweenDocuments(GH_Document oldDocument, GH_Document newDocument)
Overrides the MovedBetweenDocuments method and delegates the call to all parameters.
inherited fromGH_Component
oldDocument (GH_Document)Document that used to own this object.
newDocument (GH_Document)Document that now owns ths object.

NewInstanceGuid

public void NewInstanceGuid()
Generate a new random instance GUID
inherited fromGH_InstanceDescription
NewInstanceGuid

NewInstanceGuid

public void NewInstanceGuid(Guid UUID)
Set the instance ID to be a specific GUID. This is very dangerous, only use this function if you're 6"4' and your first name is David.
inherited fromGH_InstanceDescription
UUID (Guid)
NewInstanceGuid

OnAttributesChanged

public void OnAttributesChanged()
Raises the AttributesChanged event on the toplevel object.
inherited fromGH_DocumentObject

OnDisplayExpired

public void OnDisplayExpired(bool redraw)
Raises the DisplayExpired event on the toplevel object.
inherited fromGH_DocumentObject
redraw (bool)If True, the canvas will be immediately redrawn.
OnDisplayExpired

OnObjectChanged

public void OnObjectChanged(GH_ObjectChangedEventArgs e)
inherited fromGH_DocumentObject
OnObjectChanged

OnObjectChanged

public void OnObjectChanged(GH_ObjectEventType eventType, object tag)
inherited fromGH_DocumentObject
eventType (GH_ObjectEventType)
tag (object)
OnObjectChanged

OnObjectChanged

public void OnObjectChanged(GH_ObjectEventType eventType)
inherited fromGH_DocumentObject
eventType (GH_ObjectEventType)
OnObjectChanged

OnObjectChanged

public void OnObjectChanged(string customEvent, object tag)
inherited fromGH_DocumentObject
customEvent (string)
tag (object)
OnObjectChanged

OnObjectChanged

public void OnObjectChanged(string customEvent)
inherited fromGH_DocumentObject
customEvent (string)
OnObjectChanged

OnPingDocument

public GH_Document OnPingDocument()
Raise the PingDocument Event on the toplevel object and try to find the document which owns this object.
inherited fromGH_DocumentObject
The document which owns this object if successful, or nothing if no document owns this object.
OnPingDocument

OnPreviewExpired

public void OnPreviewExpired(bool redraw)
Raises the PreviewExpired event on the toplevel object.
inherited fromGH_DocumentObject
redraw (bool)If True, the viewports will be immediately redrawn.
OnPreviewExpired

OnSolutionExpired

public void OnSolutionExpired(bool recompute)
Raises the SolutionExpired event on the toplevel object. You probably want to call ExpireSolution() instead of this method directly.
inherited fromGH_DocumentObject
recompute (bool)If True, the solution will be immediately recalculated.
OnSolutionExpired

PostConstructor

protected virtual void PostConstructor()
The PostConstructor is called from within each constructor. DO NOT OVERRIDE THIS unless you know what you are doing.
inherited fromGH_Component

Read

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

ReadFull

public virtual bool ReadFull(GH_IReader reader)
GH_InstanceDescription does not by default serialize all fields. Use this function to read all fields from the archive. This method is compatible with the default Write()/Read() operations.
inherited fromGH_InstanceDescription
reader (GH_IReader)Writer for deserialization.
True on success, false on failure.

RecordUndoEvent

public Guid RecordUndoEvent(string undoName, IGH_UndoAction action)
Record a specific object change undo event.
inherited fromGH_DocumentObject
undoName (string)Name of undo record.
action (IGH_UndoAction)Undo action to record.
The ID of the newly added record or Guid.Empty on failure.
RecordUndoEvent

RecordUndoEvent

public Guid RecordUndoEvent(string undoName)
Record a generic object change undo event.
inherited fromGH_DocumentObject
undoName (string)Name of undo record.
The ID of the newly added record or Guid.Empty on failure.
RecordUndoEvent

RecordUndoEvent

public void RecordUndoEvent(GH_UndoRecord record)
Record an entire undo record.
inherited fromGH_DocumentObject
record (GH_UndoRecord)Record to push.
RecordUndoEvent

RegisterInputParams

#
protected override void RegisterInputParams(GH_InputParamManager pManager)

RegisterOutputParams

#
protected override void RegisterOutputParams(GH_OutputParamManager pManager)

RegisterRemoteIDs

public override void RegisterRemoteIDs(GH_GuidTable table)
Registers all my input parameters with the UUID_LookUpTable
inherited fromGH_Component
table (GH_GuidTable)

RemovedFromDocument

public override void RemovedFromDocument(GH_Document document)
Overrides the RemovedFromDocument method and delegates the call to all parameters.
inherited fromGH_Component
document (GH_Document)Document that now no longer owns this object.

RuntimeMessages

public override IList<string> RuntimeMessages(GH_RuntimeMessageLevel level)
Gets the list of cached runtime messages that were recorded during solver-time processes. For components, the set of runtime messages also includes input and output parameters.
inherited fromGH_Component
level (GH_RuntimeMessageLevel)Runtime message type to retrieve.
A list of runtime message strings.

SDKCompliancy

public virtual bool SDKCompliancy(int exeVersion, int exeServiceRelease)
Test whether this object is compliant with a given Rhino version.
inherited fromGH_ActiveObject
exeVersion (int)Rhino major release (4, 5, ...).
exeServiceRelease (int)Rhino minor (service) release.
True if this object is compliant with the given Rhino release.
SDKCompliancy

SetIconOverride

public void SetIconOverride(Bitmap customIcon)
Set a new custom icon override for this object.
inherited fromGH_DocumentObject
customIcon (Bitmap)Icon override. Should be a 24x24 image.

SetValue

protected void SetValue(string valueName, bool value)
Set a named value. This value will be serialized with the component.
inherited fromGH_DocumentObject
valueName (string)Name of value.
value (bool)Value itself.

SetValue

protected void SetValue(string valueName, Color value)
Set a named value. This value will be serialized with the component.
inherited fromGH_DocumentObject
valueName (string)Name of value.
value (Color)Value itself.

SetValue

protected void SetValue(string valueName, double value)
Set a named value. This value will be serialized with the component.
inherited fromGH_DocumentObject
valueName (string)Name of value.
value (double)Value itself.

SetValue

protected void SetValue(string valueName, int value)
Set a named value. This value will be serialized with the component.
inherited fromGH_DocumentObject
valueName (string)Name of value.
value (int)Value itself.

SetValue

protected void SetValue(string valueName, string value)
Set a named value. This value will be serialized with the component.
inherited fromGH_DocumentObject
valueName (string)Name of value.
value (string)Value itself.

SolveInstance

#
protected override void SolveInstance(IGH_DataAccess DA)
DA (IGH_DataAccess)

TriggerAutoSave

public void TriggerAutoSave()
Triggers the AutoSave function on the owner document with the object_changed flag.
inherited fromGH_DocumentObject
TriggerAutoSave

TriggerAutoSave

public void TriggerAutoSave(GH_AutoSaveTrigger trigger, Guid id)
Triggers the AutoSave function on the owner document with a custom flag.
inherited fromGH_DocumentObject
trigger (GH_AutoSaveTrigger)Reason for the autosave operation. It is possible that a user has decided to avoid autosave events for specific types, so if you can, try and provide a correct trigger flag.
id (Guid)ID of autosave event. Consecutive autosave requests with the same ID will be ignored.
TriggerAutoSave

TriggerAutoSave

public void TriggerAutoSave(GH_AutoSaveTrigger trigger)
Triggers the AutoSave function on the owner document with a custom flag.
inherited fromGH_DocumentObject
trigger (GH_AutoSaveTrigger)Reason for the autosave operation. It is possible that a user has decided to avoid autosave events for specific types, so if you can, try and provide a correct trigger flag.
TriggerAutoSave

TriggerAutoSave

public void TriggerAutoSave(Guid id)
Triggers the AutoSave function on the owner document with the object_changed flag.
inherited fromGH_DocumentObject
id (Guid)ID of autosave event. Consecutive autosave requests with the same ID will be ignored.
TriggerAutoSave

ValuesChanged

protected virtual void ValuesChanged()
Override this method if you want to respond to changes to the value table. The base implementation is empty, so you don't have to call it.
inherited fromGH_DocumentObject

Write

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

WriteFull

public virtual bool WriteFull(GH_IWriter writer)
GH_InstanceDescription does not by default serialize all fields. Use this function to write all fields to the archive. This method is compatible with the default Write()/Read() operations.
inherited fromGH_InstanceDescription
writer (GH_IWriter)Writer for serialization.
True on success, false on failure.

Events

AttributesChanged

public event IGH_DocumentObject.AttributesChangedEventHandler AttributesChanged
Raised whenever the number or kind of attributes changes. This event is handled by GH_Documents who subsequently wipe their attribute caches.
inherited fromGH_DocumentObject
AttributesChanged

DisplayExpired

Raised whenever the display (on the Canvas) of a certain object becomes invalid.
inherited fromGH_DocumentObject
DisplayExpired

PingDocument

Raised whenever an object needs to know which GH_Document it belongs to.
inherited fromGH_DocumentObject
PingDocument

PreviewExpired

Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.
inherited fromGH_DocumentObject
PreviewExpired

SolutionExpired

public event IGH_DocumentObject.SolutionExpiredEventHandler SolutionExpired
Raised whenever the solution of a certain object becomes invalid.
inherited fromGH_DocumentObject
SolutionExpired