IGH_Param

References
public interface IGH_Param : IGH_ActiveObject
Base interface for all Parameter types in Grasshopper. Do not implement this interface from scratch, derive from GH_Param or GH_PersistentParam instead.

Properties

Access

#
GH_ParamAccess Access { get; set; }
Gets or sets the Access level for this parameter.

Attributes

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 fromIGH_DocumentObject

Category

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

ComponentGuid

Guid ComponentGuid { get; }
Returns a consistent ID for this object type. Every object must supply a unique and unchanging ID that is used to identify objects of the same type.
inherited fromIGH_DocumentObject

DataMapping

#
GH_DataMapping DataMapping { get; set; }
Gets or sets the data mapping of this Parameter.

DataType

#
GH_ParamData DataType { get; }
Gets the type of the current data state.

Description

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

Exposure

GH_Exposure Exposure { get; }
Gets the exposure of this object in the Graphical User Interface.
inherited fromIGH_DocumentObject

HasCategory

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

HasProxySources

#
bool HasProxySources { get; }
Gets a value indicating whether or not this parameter maintains proxy sources. Proxy sources are used during file IO, when actual sources might not be available yet. Once an IO operation has been completed there should be no more proxy sources.
True if the parameter has at least one proxy source, false if not.

HasSubCategory

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

Icon_24x24

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

Icon_24x24_Locked

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

IconDisplayMode

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

InstanceDescription

string InstanceDescription { get; }
Gets a description of the current state of the object. This field is usually the same as the Description() field, but it might be variable when overridden.
inherited fromIGH_InstanceDescription

InstanceGuid

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

IsDataProvider

bool IsDataProvider { get; }
Gets whether or not this object is capable of emitting data.
inherited fromIGH_ActiveObject

Keywords

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 fromIGH_InstanceDescription

Kind

#
GH_ParamKind Kind { get; }
Gets the parameter kind. The kind is evaluated lazily and cached.

Locked

bool Locked { get; set; }
Gets or sets the locked flag of this object. Locked objects are ignored during solutions.
inherited fromIGH_ActiveObject

MutableNickName

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

Name

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

NickName

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

Obsolete

bool Obsolete { get; }
Gets whether this object is Obsolete.
inherited fromIGH_DocumentObject

Optional

#
bool Optional { get; set; }
Gets or sets whether or not this parameter is considered optional by the owner component. Empty, non-optional parameters prevent the component from being solved.

Phase

GH_SolutionPhase Phase { get; set; }
Gets the solution phase in which this object is currently stuck.
inherited fromIGH_ActiveObject

ProcessorTime

TimeSpan ProcessorTime { get; }
Gets the most recent measured processor time.
inherited fromIGH_ActiveObject

ProxySourceCount

#
int ProxySourceCount { get; }
Gets the number of proxy sources for this parameter. Proxy sources are used during file IO, when actual sources might not be available yet. Once an IO operation has been completed there should be no more proxy sources.
The number of proxy sources associated with this parameter.

Recipients

#
IList<IGH_Param> Recipients { get; }
Gets a list of all the recipients of this parameter. I.e. a recipient has this parameter as one of the sources. The Recipient list is maintained by the parameter, do not modify it yourself.

Reverse

#
bool Reverse { get; set; }
Gets or sets the data reverse modifier of this parameter.

RuntimeMessageLevel

GH_RuntimeMessageLevel RuntimeMessageLevel { get; }
Gets the worst-case level of all messages. I.e. if only warnings have been recorded, the level will be ::warning. If even a single error exists, the level will be ::error.
inherited fromIGH_ActiveObject

Simplify

#
bool Simplify { get; set; }
Gets or sets the simplify modifier for this parameter.

SourceCount

#
int SourceCount { get; }
Gets the number of sources for this parameter.

Sources

#
IList<IGH_Param> Sources { get; }
Gets a list of source parameters. Do not modify this list, if you wish to add or remove sources, use dedicated functions like AddSource() and RemoveSource instead.
The sources for this parameter.

StateTags

#
GH_StateTagList StateTags { get; }
Gets all the StateTags that are associated with this parameter. A state tag is a visual feedback icon that represents specific internal settings.

SubCategory

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

Type

#
Type Type { get; }
Gets the Framework Type descriptor for the stored Data.

TypeName

#
string TypeName { get; }
Gets a human readable description of the data stored in this parameter.

VolatileData

#
IGH_Structure VolatileData { get; }
Gets the instance of the volatile data tree stored in this parameter.

VolatileDataCount

#
int VolatileDataCount { get; }
Gets the total number of volatile data items stored in this parameter.

WireDisplay

#
GH_ParamWireDisplay WireDisplay { get; set; }
Gets or sets the wire display style for this parameter. Wire display only affects the wires connected to the parameter input.

Methods

AddedToDocument

void AddedToDocument(GH_Document document)
This method will be called when an object is added to a document.
inherited fromIGH_DocumentObject
document (GH_Document)Document that now owns this object.

AddRuntimeMessage

void AddRuntimeMessage(GH_RuntimeMessageLevel Type, string Message)
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 fromIGH_ActiveObject
Type (GH_RuntimeMessageLevel)Type of message. Only Warnings and Errors are recorded.
Message (string)Content of message.

AddSource

#
void AddSource(IGH_Param source, int index)
Insert a new Source parameter into the Sources list. Sources provide this parameter with data at runtime.
source (IGH_Param)Source to append.
index (int)Insertion index of source.

AddSource

#
void AddSource(IGH_Param source)
Append a new Source parameter to the end of the Sources list. Sources provide this parameter with data at runtime.
source (IGH_Param)Source to append.

AddVolatileData

#
bool AddVolatileData(GH_Path path, int index, object data)
Inserts an item of volatile data into the data structure.
path (GH_Path)The branch path of the data. If the path doesn't exist yet, it will be created.
index (int)The item index of the data. If the path doesn't contain the index yet, it will be enlarged to encompass the index.
data (object)The data to store.
True on success, False on failure. If the data cannot be converted, the topology will remain unmolested.

AddVolatileDataList

#
bool AddVolatileDataList(GH_Path path, IEnumerable list)
Inserts a list of items into the data structure.
path (GH_Path)The branch path of the data. If the path doesn't exist yet, it will be created.
list (IEnumerable)The data list to store.

AddVolatileDataTree

#
bool AddVolatileDataTree(IGH_Structure tree)
Insert an entire data tree into this parameter.
tree (IGH_Structure)Data tree to insert.
True on success, false on failure.

AppendMenuItems

bool AppendMenuItems(ToolStripDropDown menu)
This function is called when a context menu is about to be displayed. Override it to set custom items.
inherited fromIGH_DocumentObject
menu (ToolStripDropDown)Menu object to populate.

ClearData

void ClearData()
This function is called whenever the object needs to clear all solution data. This usually amounts to wiping volatile caches and messages. This function will not affect any other objects, but it will set the Phase flag to Blank
inherited fromIGH_ActiveObject

ClearProxySources

#
void ClearProxySources()
Remove all proxy sources without attempting to relink them.

ClearRuntimeMessages

void ClearRuntimeMessages()
Clear all message lists.
inherited fromIGH_ActiveObject

CollectData

void CollectData()
This function is called whenever the object is required to collect all data. Either from Persistent records, from source params or whatever. This step is only performed if the phase flag is Blank or Failed. Upon completion, the phase flag will be set to Collected
inherited fromIGH_ActiveObject

ComputeData

void ComputeData()
This function is called whenever the object is required to generate new data. This step is only performed by some objects and only when the Phase flag is Collected. Upon completion, the Phase will be Computed. If this object throws exceptions, it is the responsibility of the caller to set the Phase flag to Failed.
inherited fromIGH_ActiveObject

CreateAttributes

void CreateAttributes()
Create new default attributes for this object. You should only call this function when the Attributes() field is null.
inherited fromIGH_DocumentObject

CreateProxySources

#
void CreateProxySources()
Convert all proper source parameters into proxy sources.

DependsOn

bool DependsOn(IGH_ActiveObject PotentialSource)
Solve the inheritance relationship between this object and a potential parental object.
inherited fromIGH_ActiveObject
PotentialSource (IGH_ActiveObject)

DocumentContextChanged

void DocumentContextChanged(GH_Document document, GH_DocumentContext context)
This method will be called when the document that owns this object moves into a different context.
inherited fromIGH_DocumentObject
document (GH_Document)Document that owns this object.
context (GH_DocumentContext)The reason for this event.

ExpirePreview

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 fromIGH_DocumentObject
redraw (bool)

ExpireSolution

void ExpireSolution(bool recompute)
Call this function whenever you do something which expires the current solution. This will make sure all caches are erased, all downstream objects are expired and that the event is raised. The default implementation merely places a call to OnSolutionExpired(), override this function in derived classes to make sure you clear local data caches and expire downstream objects.
inherited fromIGH_DocumentObject
recompute (bool)If True, the solution will be recomputed straight away.

IsolateObject

void IsolateObject()
Destroy all connections to other objects.
inherited fromIGH_DocumentObject

MovedBetweenDocuments

void MovedBetweenDocuments(GH_Document oldDocument, GH_Document newDocument)
This method will be called when an object is moved from one document to another.
inherited fromIGH_DocumentObject
oldDocument (GH_Document)Document that used to own this object.
newDocument (GH_Document)Document that now owns ths object.

NewInstanceGuid

void NewInstanceGuid()
Generate a new random instance GUID
inherited fromIGH_InstanceDescription

NewInstanceGuid

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 called David.
inherited fromIGH_InstanceDescription
UUID (Guid)

OnAttributesChanged

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

OnDisplayExpired

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

OnObjectChanged

void OnObjectChanged(GH_ObjectChangedEventArgs e)
Raises the ObjectChanged event on the current (!not the top level!) object.
inherited fromIGH_DocumentObject
e (GH_ObjectChangedEventArgs)Fully constructed event arguments.

OnObjectChanged

void OnObjectChanged(GH_ObjectEventType eventType, object tag)
Raises the ObjectChanged event on the current (!not the top level!) object.
inherited fromIGH_DocumentObject
eventType (GH_ObjectEventType)Type of change.
tag (object)Tag to apply to the event arguments.

OnObjectChanged

void OnObjectChanged(GH_ObjectEventType eventType)
Raises the ObjectChanged event on the current (!not the top level!) object.
inherited fromIGH_DocumentObject
eventType (GH_ObjectEventType)Type of change.

OnObjectChanged

void OnObjectChanged(string customEvent, object tag)
Raises the ObjectChanged event on the current (!not the top level!) object.
inherited fromIGH_DocumentObject
customEvent (string)Custom change type name.
tag (object)Tag to apply to the event arguments.

OnObjectChanged

void OnObjectChanged(string customEvent)
Raises the ObjectChanged event on the current (!not the top level!) object.
inherited fromIGH_DocumentObject
customEvent (string)Custom change type name.

OnPingDocument

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

OnPreviewExpired

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

OnSolutionExpired

void OnSolutionExpired(bool recompute)
Raises the SolutionExpired event on the toplevel object.
inherited fromIGH_DocumentObject
recompute (bool)If True, the solution will be immediately recalculated.

Read

bool Read(GH_IReader reader)
This method is called whenever the instance is required to deserialize itself.
inherited fromGH_ISerializable
reader (GH_IReader)Reader object to deserialize from.
True on success, false on failure.

RecordUndoEvent

Guid RecordUndoEvent(string undoName, IGH_UndoAction action)
Record a specific object change undo event.
inherited fromIGH_DocumentObject
undoName (string)Name of undo record.
action (IGH_UndoAction)Undo action to record.

RecordUndoEvent

Guid RecordUndoEvent(string undoName)
Record a generic object change undo event.
inherited fromIGH_DocumentObject
undoName (string)Name of undo record.

RecordUndoEvent

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

RegisterRemoteIDs

void RegisterRemoteIDs(GH_GuidTable id_list)
If this object depends on Rhino Objects, you must register the UUIDs of those objects. Failure to do so will result in faulty event handling.
inherited fromIGH_ActiveObject
id_list (GH_GuidTable)The object ID database Grasshopper is responsive to.

RelinkProxySources

#
bool RelinkProxySources(GH_Document document)
Attempt to replace all proxy sources with real sources. Proxy sources are used during file IO, when actual sources might not be available yet. Once an IO operation has been completed there should be no more proxy sources.
document (GH_Document)
True on success, false on failure.

RemoveAllSources

#
void RemoveAllSources()
Remove all sources from this parameter.

RemovedFromDocument

void RemovedFromDocument(GH_Document document)
This method will be called when an object is removed from a document.
inherited fromIGH_DocumentObject
document (GH_Document)Document that now no longer owns this object.

RemoveEffects

#
void RemoveEffects()
Remove all post-process effects.

RemoveSource

#
void RemoveSource(Guid source_id)
Remove the specified source from this parameter.
source_id (Guid)InstanceID of source to remove.

RemoveSource

#
void RemoveSource(IGH_Param source)
Remove the specified source from this parameter.
source (IGH_Param)Source to remove.

ReplaceSource

#
void ReplaceSource(Guid old_source_id, IGH_Param new_source)
Replace an existing source with a new one. If the old_source does not exist in this parameter, nothing happens.
old_source_id (Guid)Source to replace.
new_source (IGH_Param)Source to replace with.

ReplaceSource

#
void ReplaceSource(IGH_Param old_source, IGH_Param new_source)
Replace an existing source with a new one. If the old_source does not exist in this parameter, nothing happens.
old_source (IGH_Param)Source to replace.
new_source (IGH_Param)Source to replace with.

RuntimeMessages

IList<string> RuntimeMessages(GH_RuntimeMessageLevel level)
Gets the list of cached runtime messages that were recorded during solver-time processes.
inherited fromIGH_ActiveObject
level (GH_RuntimeMessageLevel)Runtime message type to retrieve.
A list of runtime message strings.

SDKCompliancy

bool SDKCompliancy(int exeVersion, int exeServiceRelease)
Test whether this object is compliant with a given Rhino version.
inherited fromIGH_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.

TriggerAutoSave

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

TriggerAutoSave

void TriggerAutoSave(GH_AutoSaveTrigger trigger, Guid id)
Triggers the AutoSave function on the owner document with a custom flag.
inherited fromIGH_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

void TriggerAutoSave(GH_AutoSaveTrigger trigger)
Triggers the AutoSave function on the owner document with a custom flag.
inherited fromIGH_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

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

Write

bool Write(GH_IWriter writer)
This method is called whenever the instance is required to serialize itself.
inherited fromGH_ISerializable
writer (GH_IWriter)Writer object to serialize with.
True on success, false on failure.

Events

AttributesChanged

Raised whenever the number or kind of attributes changes. This event is handled by GH_Documents who subsequently wipe their attribute caches.
inherited fromIGH_DocumentObject

DisplayExpired

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

ObjectChanged

Raised whenever some property of the object changes that would affect remote instances.
inherited fromIGH_DocumentObject

PingDocument

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

PreviewExpired

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

SolutionExpired

Raised whenever the solution of a certain object becomes invalid.
inherited fromIGH_DocumentObject