ComponentFunctionInfo

References
public abstract class ComponentFunctionInfo
Defines the base class for a function representing a component. This class is abstract.

Constructors

ComponentFunctionInfo

#
Instantiates a new instance of the function class. This is not meant for public consumption.
protected ComponentFunctionInfo(
name,
Name.
namespace,
Namespace.
description,
Description.
inputNames,
Input parameter names.
inputDescriptions,
Input parameter descriptions.
inputTypeNames,
Input parameter type names.
inputsOptional,
Indications for optional inputs.
outputNames,
Output names.
outputDescriptions,
Output descriptions.
outputTypeNames,
Output type names.
componentGuid
Component guid.
)

Properties

ComponentGuid

#Since v6.0
The unique identifier of the Grasshopper component. It is the original developer's responsibility to ensure that this ID is unique.
public Guid ComponentGuid { get; }

Delegate

#Since v6.0
Returns a delegate that can be directly invoked using a list of arguments. This flattens trees.
public Delegate Delegate { get; }

DelegateNoWarnings

#Since v6.0
Returns a delegate that can be directly invoked using a list of arguments. This flattens trees.
public Delegate DelegateNoWarnings { get; }

DelegateTree

#Since v6.0
Returns a delegate that can be directly invoked using a list of arguments. This considers trees and simplifies single-output components.
public Delegate DelegateTree { get; }

DelegateTreeNoWarnings

#Since v6.0
Returns a delegate that can be directly invoked using a list of arguments. This considers trees and simplifies single-output components.
public Delegate DelegateTreeNoWarnings { get; }

Description

#Since v6.0
The function description.
public string Description { get; }

FullName

#Since v6.0
Returns the name of the component prefixed by, if existing, the namespace.
public string FullName { get; }

FullScriptingName

#Since v6.0
Shows the full name of the component, including optional periods. Removes spaces and common operator signs.
public string FullScriptingName { get; }

InputDescriptions

#Since v6.0
The function input parameter descriptions.
public IReadOnlyList<string> InputDescriptions { get; }

InputNames

#Since v6.0
The function input parameter names.
public IReadOnlyList<string> InputNames { get; }

InputsOptional

#Since v6.0
Indications for each function input parameter whether it is optional.
public IReadOnlyList<bool> InputsOptional { get; }

InputTypeNames

#Since v6.0
The function input type names.
public IReadOnlyList<string> InputTypeNames { get; }

IsDefault

#Since v6.0
Determines if the component is a default one.
public bool IsDefault { get; }

Name

#Since v6.0
The function name.
public string Name { get; }

Namespace

#Since v6.0
The function namespace.
public string Namespace { get; }

OutputDescriptions

#Since v6.0
Grasshopper returns several items in general. This property returns the output descriptions.
public IReadOnlyList<string> OutputDescriptions { get; }

OutputNames

#Since v6.0
Grasshopper returns several items in general. This property returns the output names.
public IReadOnlyList<string> OutputNames { get; }

OutputTypeNames

#Since v6.0
Grasshopper returns several items in general. This property returns the output type names.
public IReadOnlyList<string> OutputTypeNames { get; }

Methods

Evaluate

#Since v6.0
Evaluates the component with a set of arguments. There needs to be an argument for each input param, and each output param gives an entry in the output array.
public abstract object[] Evaluate(
args,
The arguments list. Each item is assigned to each input param, in order.
keepTree,
A value indicating whether trees should be considered valid inputs, and should be returned. In this case, output variables are not simplified to common types.
out string[]
warnings
A possible list of warnings, or null.
)
Remarks: For component that store no state, this method is thread safe.
An array of objects, each representing an output result.

Invoke

#Since v7.0
Runs Evaluate(IEnumerable, bool, string[]) with keepTree equal to false, and raises an exception on the first warning.
public object[] Invoke(
params object[]
args
Arguments. One for each component input.
)
Items.

InvokeKeepTree

#Since v7.0
Runs Evaluate(IEnumerable, bool, string[]) with keepTree equal to true and raises an exception on the first warning.
public object[] InvokeKeepTree(
params object[]
args
Arguments. One for each component input.
)
Items.

InvokeKeepTreeSilenceWarnings

#Since v7.0
Runs Evaluate(IEnumerable, bool, string[]) with keepTree equal to true, and discards warnings (this is a dangerous operation!).
public object[] InvokeKeepTreeSilenceWarnings(
params object[]
args
Arguments.
)
Array of items.

InvokeSilenceWarnings

#Since v7.0
Runs Evaluate(IEnumerable, bool, string[]) with keepTree equal to false, then simplifies output with SimplifyTreeOutput(object[], string[], bool) and discards warnings (this is a dangerous operation!).
public object[] InvokeSilenceWarnings(
params object[]
args
Arguments. One for each component input.
)
Items.

ToString

#
Returns a string representing this function.
public override string ToString()
The namespace and the name.
Object.ToString