GH_ComponentParamServer

References
Wraps all members and functions needed for GH_Component to manage its input and output parameters.

Properties

Input

#
Gets or sets the input list of parameters. Do not insert or remove parameters from this list, use the dedicated functions instead.
public List<IGH_Param> Input { get; }

InputWidth

#
Gets the width of the largest input parameter.
public float InputWidth { get; }

OnlyTreeAndListParameters

#
Returns True if every input parameter is either a list or a tree parameter.
public bool OnlyTreeAndListParameters { get; }

OnlyTreeParameters

#
Returns True if every input parameter is a tree parameter.
public bool OnlyTreeParameters { get; }

Output

#
Gets or sets the output list of parameters. Do not insert or remove parameters from this list, use the dedicated functions instead.
public List<IGH_Param> Output { get; }

OutputWidth

#
Gets the width of the largest output parameter.
public float OutputWidth { get; }

Owner

#
Gets the owner component of this instance
public IGH_Component Owner { get; }

Methods

AccessCount

#
Returns the total number of input parameters that match the access mask.
public int AccessCount(
access
Access flag mask.
)

Clear

#
Removes all input and output parameters.
public void Clear()

Clear

#
Removes all input and output parameters.
public void Clear(
isolate
If true, parameters that are removed will be isolated from sources and recipients.
)

CreateDuplicate

#
Attempts to duplicate a parameter. Attributes will be ignored. Warning! The duplicate will have the same ID as the original!
public static IGH_Param CreateDuplicate(
original
Parameter to duplicate.
)
A dupicate of the original or null on failure.

EmitSyncObject

#
Create a synch object that stores a shallow representation of this server. Cache this object if you're planning to make sweeping changes to this param-server. Then, once you are finished call the Sync() function to perform cleanup of removed parameters. This is a utility function and you can choose to perform cleanup yourself.
public GH_ComponentParamServer.IGH_SyncObject EmitSyncObject()

Find

#
Find the parameter that has the given InstanceGuid.
public IGH_Param Find(
id
InstanceID to search for.
)
The parameter with the matching ID or null on failure.

GetEnumerator

#
Gets a customized enumerator which iterates over all (both input and output) parameters.
public IEnumerator<IGH_Param> GetEnumerator()

GetEnumerator1

#
Gets a customized enumerator which iterates over all (both input and output) parameters.
[EditorBrowsable(EditorBrowsableState.Never)] public IEnumerator GetEnumerator1()

GetHashCode

#
Creates a SHA1 hash from the parameter data.
public Guid GetHashCode(
fields
Fields to include.
)
A Guid representing a SHA hash of the parameter fields.

GetHashCode

#
public override int GetHashCode()

GetParam

#
Finds the parameter that matches the specified search mask.
public IGH_Param GetParam(
name,
Name to search for.
side
)
The the parameter, or null if no parameter was found to match

IndexOfInputParam

#
Finds the index of the input parameter that matches the specified search mask.
public int IndexOfInputParam(
id
ID to search for
)
The index of the parameter, or -1 if no parameter was found to match

IndexOfInputParam

#
Finds the index of the input parameter that matches the specified search mask.
public int IndexOfInputParam(
name
Name to search for.
)
The index of the parameter, or -1 if no parameter was found to match

IndexOfOutputParam

#
Finds the index of the output parameter that matches the specified search mask.
public int IndexOfOutputParam(
id
ID to search for.
)
The index of the parameter, or -1 if no parameter was found to match

IndexOfOutputParam

#
Finds the index of the output parameter that matches the specified search mask.
public int IndexOfOutputParam(
name
Name to search for.
)
The index of the parameter, or -1 if no parameter was found to match

InventUniqueNickname

#
Create a new, unique parameter nickname.
public static string InventUniqueNickname(
allowedChars,
Allowed character set for naming logic.
existingNames
A collection of parameter names to avoid.
)
The first name combination that doesn't occur in the existingNames collection.

InventUniqueNickname

#
Create a new, unique parameter nickname.
public static string InventUniqueNickname(
allowedChars,
Allowed character set for naming logic.
existingNames
A collection of parameter names to avoid.
)
The first name combination that doesn't occur in the existingNames collection.

IsInputParam

#
Returns True if this parameter is an input child of the component
public bool IsInputParam(
param
Parameter to test.
)

IsOutputParam

#
Returns True if this parameter is an output child of the component
public bool IsOutputParam(
param
Parameter to test.
)

IsParam

#
Returns True if this parameter is a child of the component
public bool IsParam(
param
Parameter to test.
)

OnParametersChanged

#
Call this function when you change input/output parameter lists or types. This function will wipe all caches that are potentially invalid. PerformLayout on the component attributes will be called.
public void OnParametersChanged()

Read

#
Read all parameter data from an IO archive.
public bool Read(
reader
Object to read with.
)
True on success, false on failure.
Read

ReadAllParameterData

#
Deserialize all possible parameter data. You can only use this method if the archive was made using the WriteAllParameterData() method.
[EditorBrowsable(EditorBrowsableState.Never)] public bool ReadAllParameterData(
reader
Reader object to deserialize from.
)
True on success, false on failure.

RegisterInputParam

#
Add a parameter at the specific index of the input list.
public bool RegisterInputParam(
new_param,
at_index
)

RegisterInputParam

#
Add a parameter to the end of the input list.
public bool RegisterInputParam(
new_param
)

RegisterOutputParam

#
Add a parameter at the specific index of the output list.
public bool RegisterOutputParam(
new_param,
at_index
)

RegisterOutputParam

#
Add a parameter to the end of the output list.
public bool RegisterOutputParam(
new_param
)

RepairParamAssociations

#
Makes sure all parameter attributes are a-ok. If you stick to regular functions, you shouldn't have to call this.
public void RepairParamAssociations()

RepairProxyParams

#
Attempt to fix all proxy params. Returns false if a single one fails.
public bool RepairProxyParams(
document
Document that contains potential proxy targets.
)

SortInput

#
Sort the input parameter order based on a numeric key array.
public void SortInput(
keys
Array of double precision numbers to function as sorting keys.
)

SortInput

#
Sort the input parameter order based on a numeric key array.
public void SortInput(
keys
Array of single precision numbers to function as sorting keys.
)

SortInput

#
Sort the input parameter order based on a numeric key array.
public void SortInput(
int[]
keys
Array of integer precision numbers to function as sorting keys.
)

SortOutput

#
Sort the input parameter order based on a numeric key array.
public void SortOutput(
keys
Array of double precision numbers to function as sorting keys.
)

SortOutput

#
Sort the output parameter order based on a numeric key array.
public void SortOutput(
keys
Array of single precision numbers to function as sorting keys.
)

SortOutput

#
Sort the output parameter order based on a numeric key array.
public void SortOutput(
int[]
keys
Array of integer precision numbers to function as sorting keys.
)

Sync

#
Sync changes from a prerecorded state. All param references in the sync object which are no longer present in the current server will be properly deleted. The sync object will be reset in the process, so you can only call this function with a specific Sync object once.
public void Sync(
sync_data,
Sync object. Should be obtained by calling EmitSyncObject()
ref int
cleanup_count
Number of parameters that were cleaned up.
)

Sync

#
Sync changes from a prerecorded state. All param references in the sync object which are no longer present in the current server will be properly deleted. The sync object will be reset in the process, so you can only call this function with a specific Sync object once.
public void Sync(
sync_data
Sync object. Should be obtained by calling EmitSyncObject()
)

Sync

#
Sync changes from a prerecorded state. All param references in the sync object which are no longer present in the current server will be properly deleted. The sync object will be reset in the process, so you can only call this function with a specific Sync object once.
public void Sync(
sync_data
Sync object. Should be obtained by calling EmitSyncObject()
)

UnregisterInputParameter

#
Removes the specified parameter from this component.
public bool UnregisterInputParameter(
param,
Parameter to remove
isolate
If true, parameters that are removed will be isolated from sources and recipients.
)

UnregisterInputParameter

#
Removes the specified parameter from this component.
public bool UnregisterInputParameter(
param
Parameter to remove
)

UnregisterOutputParameter

#
Removes the specified parameter from this component.
public bool UnregisterOutputParameter(
param,
Parameter to remove
isolate
If true, parameters that are removed will be isolated from sources and recipients.
)

UnregisterOutputParameter

#
Removes the specified parameter from this component.
public bool UnregisterOutputParameter(
param
Parameter to remove
)

UnregisterParameter

#
Removes the specified parameter from this component.
public bool UnregisterParameter(
param,
Parameter to remove
isolate
If true, parameters that are removed will be isolated from sources and recipients.
)

UnregisterParameter

#
Removes the specified parameter from this component.
public bool UnregisterParameter(
param
Parameter to remove
)

Write

#
Write all parameter data to an IO archive.
public bool Write(
writer
Object to write with.
)
True on success, false on failure.
Write

WriteAllParameterData

#
Serialize all possible parameter data. This is a sledge-hammer approach, do not use unless you're desperate.
[EditorBrowsable(EditorBrowsableState.Never)] public bool WriteAllParameterData(
writer
Writer object to serialize to.
)
True on success, false on failure.

WriteParamHashData

#
Write parameter data to a binary writer.
public static void WriteParamHashData(
writer,
Writer to write with.
param,
Parameter to serialize.
fields
Fields of parameter to serialize.
)
Remarks: This is useful for hashing purposes, there is no way to deserialize data written with this method.

Events

ParameterChanged

#
Raised whenever there is a change to any parameter. If you only care about NickName or Source changes, handle the ParameterNickNameChanged or ParameterSourcesChanged events instead.

ParameterNickNameChanged

#
Raised whenever a parameter nickname change is accepted.

ParameterSourcesChanged

#
Raised whenever the source list of an input parameter is changed.