IGH_DataAccess

References
public interface IGH_DataAccess
Provides access to component parameters, in order to retrieve and assign data during solutions.

Properties

Iteration

#
int Iteration { get; }
Gets the current iteration count. The first time the SolveInstance() function is called on a component during a solution the Iteration counter will be zero. It will be incremented by one for every subsequent call.
An integer representing the iteration count.

Methods

AbortComponentSolution

#
void AbortComponentSolution()
Call this method if you wish to stop solving this component.

BlitData<Q>

#
bool BlitData<Q>(int paramIndex, GH_Structure<Q> tree, bool overwrite)
Creates a direct copy of an existing data structure. The existing generic instance must of the exact same type as the target parameter.
paramIndex (int)Index of output parameter.
tree (GH_Structure<Q>)Parameter whose data to blit
overwrite (bool)If true, any existing data will be removed.

DisableGapLogic

#
void DisableGapLogic()
Call this function if you want to disable the gap null logic for the current iteration.

DisableGapLogic

#
void DisableGapLogic(int paramIndex)
Call this function if you want to disable the gap null logic for a specific output parameter.
paramIndex (int)Index of output parameter to disable.

GetData<T>

#
bool GetData<T>(int index, ref T destination)
Retrieve data from an input parameter during GH_Component.SolveInstance().
index (int)
destination (ref T)
True on success, false on failure.

GetData<T>

#
bool GetData<T>(string name, ref T destination)
Retrieve data from an input parameter during GH_Component.SolveInstance().
Remarks: Parameter access by index is faster, consider using the other overload if possible.
name (string)
destination (ref T)
True on success, false on failure.

GetDataList<T>

#
bool GetDataList<T>(int index, List<T> list)
Retrieve an entire list of data from an input parameter during GH_Component.SolveInstance().
index (int)
list (List<T>)
True on success, false on failure.

GetDataList<T>

#
bool GetDataList<T>(string name, List<T> list)
Retrieve an entire list of data from an input parameter during GH_Component.SolveInstance().
Remarks: Parameter access by index is faster, consider using the other overload if possible.
name (string)
list (List<T>)
True on success, false on failure.

GetDataTree<T>

#
bool GetDataTree<T>(int index, ref GH_Structure<T> tree)
Retrieve an entire data tree from an input parameter during GH_Component.SolveInstance().
index (int)
tree (ref GH_Structure<T>)
True on success, false on failure.

GetDataTree<T>

#
bool GetDataTree<T>(string name, ref GH_Structure<T> tree)
Retrieve an entire data tree from an input parameter during GH_Component.SolveInstance().
Remarks: Parameter access by index is faster, consider using the other overload if possible.
name (string)
tree (ref GH_Structure<T>)
True on success, false on failure.

IncrementIteration

#
void IncrementIteration()
Increments the iteration count by 1.

ParameterTargetIndex

#
int ParameterTargetIndex(int paramIndex)
Get the target index for the specified output parameter.
paramIndex (int)Index of output parameter.

ParameterTargetPath

#
GH_Path ParameterTargetPath(int paramIndex)
Get the target path for the specified output parameter.
paramIndex (int)Index of output parameter.

SetData

#
bool SetData(int paramIndex, object data, int itemIndexOverride)
Expert user function. Stores data in an output parameter during GH_Component.SolveInstance(). Use this function only for setting individual data items. If you want to set lists of data, you *must* call SetDataList() instead.
paramIndex (int)Index of the output parameter at which to store the data.
data (object)Data to store. Data will be converted if necessary, but it will not be duplicated automatically.
itemIndexOverride (int)Typically the item index is a result of Data matching logic. If you want to override the item index, then call this function.

SetData

#
bool SetData(int paramIndex, object data)
Stores data in an output parameter during GH_Component.SolveInstance(). Use this function only for setting individual data items. If you want to set lists of data, you *must* call SetDataList() instead.
paramIndex (int)Index of the output parameter at which to store the data.
data (object)Data to store. Data will be converted if necessary, but it will not be duplicated automatically.

SetData

#
bool SetData(string paramName, object data)
Stores data in an output parameter during GH_Component.SolveInstance().
Remarks: Parameter access by index is faster, consider using the other overload if possible.
paramName (string)Name of the output parameter at which to store the data.
data (object)Data to store. Data will be converted if necessary, but it will not be duplicated automatically.

SetDataList

#
bool SetDataList(int paramIndex, IEnumerable data, int listIndexOverride)
Expert user function. Stores a list of data in an output parameter during GH_Component.SolveInstance().
paramIndex (int)Index of the output parameter at which to store the list.
data (IEnumerable)Data to store. Data will be converted if necessary, but it will not be duplicated automatically.
listIndexOverride (int)Typically the branch index is a result of Data matching logic. If you want to override the branch index, then call this function.

SetDataList

#
bool SetDataList(int paramIndex, IEnumerable data)
Stores a list of data in an output parameter during GH_Component.SolveInstance().
paramIndex (int)Index of the output parameter at which to store the list.
data (IEnumerable)Data to store. Data will be converted if necessary, but it will not be duplicated automatically.

SetDataList

#
bool SetDataList(string paramName, IEnumerable data)
Stores data in an output parameter during GH_Component.SolveInstance().
Remarks: Parameter access by index is faster, consider using the other overload if possible.
paramName (string)Name of the parameter at which to store the data.
data (IEnumerable)Data to store. Data will be converted if necessary, but it will not be duplicated automatically.

SetDataTree

#
bool SetDataTree(int paramIndex, IGH_DataTree tree)
Folds a utility tree representation into this tree.
paramIndex (int)Index of output parameter to merge with.
tree (IGH_DataTree)Tree to merge

SetDataTree

#
bool SetDataTree(int paramIndex, IGH_Structure tree)
Folds a utility tree representation into this tree.
paramIndex (int)Index of output parameter to merge with.
tree (IGH_Structure)Tree to merge

Util_CountNonNullRefs<T>

#
int Util_CountNonNullRefs<T>(List<T> L)
Count all object references in L
L (List<T>)List to parse
Number of proper objects in L

Util_CountNullRefs<T>

#
int Util_CountNullRefs<T>(List<T> L)
Count all null references in L
L (List<T>)List to parse
Number of nulls in L

Util_EnsureNonNullCount<T>

#
bool Util_EnsureNonNullCount<T>(List<T> L, int N)
Tests a list to see if it contains sufficient non-null references.
L (List<T>)List to parse
N (int)
True if L contains N or more non-null references.

Util_FirstNonNullItem<T>

#
int Util_FirstNonNullItem<T>(List<T> L)
Returns the index of the first non-null item in a list.
L (List<T>)List to parse.
The index of the first non-null item or -1 if no object reference could be found.

Util_RemoveNullRefs<T>

#
List<T> Util_RemoveNullRefs<T>(List<T> L)
Remove all null references from a list of items.
L (List<T>)List to filter
List containing only non-null items. References are shared with L