Gh1MigrationRule

References
public sealed class Gh1MigrationRule : IMigrateComponent
A declarative mapping of one Grasshopper 1 component onto one Grasshopper 2 component.

Constructors

Gh1MigrationRule

#
public Gh1MigrationRule(string gh1Id, string gh2Id, (int gh1, int gh2)[] inputs, (int gh1, int gh2)[] outputs)
Create a rule with explicit parameter maps.
gh1Id (string)ComponentGuid of the Grasshopper 1 component.
gh2Id (string)IoId of the Grasshopper 2 component.
inputs ((int gh1, int gh2)[])Input map, from Grasshopper 1 index to Grasshopper 2 index.
outputs ((int gh1, int gh2)[])Output map, from Grasshopper 1 index to Grasshopper 2 index.

Properties

Grasshopper1Id

#
public Guid Grasshopper1Id { get; }
Gets the ComponentGuid of the Grasshopper 1 component migrated by this rule.
Grasshopper1Id

Grasshopper2Id

#
public Guid Grasshopper2Id { get; }
Gets the IoId of the Grasshopper 2 component which replaces it.

Methods

AngleInput

#
public Gh1MigrationRule AngleInput(int gh1Input, int gh2Input)
Map a Grasshopper 1 numeric angle input onto a Grasshopper 2 Angle input.
gh1Input (int)Index of the Grasshopper 1 angle input, not also in the input map.
gh2Input (int)Index of the Grasshopper 2 Angle input.
This rule, for chaining.

AngleOutput

#
public Gh1MigrationRule AngleOutput(int gh1Output, int gh2Output)
Map a Grasshopper 1 numeric angle output onto a Grasshopper 2 Angle output.
gh1Output (int)Index of the Grasshopper 1 angle output, not also in the output map.
gh2Output (int)Index of the Grasshopper 2 Angle output.
This rule, for chaining.

Dropping

#
public Gh1MigrationRule Dropping(int gh1Input)
Allow a Grasshopper 1 input to be dropped even when a wire is attached to it.
gh1Input (int)Index of the Grasshopper 1 input which may always be dropped.
This rule, for chaining.
Explicit

IMigrateComponent.Migrate

#
component (IGH_Component)
Migrate

HidingOutput

#
public Gh1MigrationRule HidingOutput(int gh2Output)
Hide a visible modular output which no Grasshopper 1 output maps onto; mapped outputs are shown by the transfer.
gh2Output (int)Index of the Grasshopper 2 output.
This rule, for chaining.

Identity

#
public static Gh1MigrationRule Identity(string gh1Id, string gh2Id, int inputs, int outputs)
Create a rule which maps the first inputs and the first outputs onto the parameters at the same indices.
gh1Id (string)ComponentGuid of the Grasshopper 1 component.
gh2Id (string)IoId of the Grasshopper 2 component.
inputs (int)Number of leading inputs which map onto each other.
outputs (int)Number of leading outputs which map onto each other.
The newly created rule.

ShowingOutput

#
public Gh1MigrationRule ShowingOutput(int gh2Output)
Show a hidden modular output, because the Grasshopper 1 component always showed its counterpart.
gh2Output (int)Index of the Grasshopper 2 output.
This rule, for chaining.

ViaInput

#
public Gh1MigrationRule ViaInput(int gh1Input, Func<IParameter> relay)
Send a mapped input through a relay parameter.
gh1Input (int)Index of the Grasshopper 1 input, which must also appear in the input map.
relay (Func<IParameter>)Factory for the relay parameter.
This rule, for chaining.

ViaOutput

#
public Gh1MigrationRule ViaOutput(int gh1Output, Func<IParameter> relay)
Send a mapped output through a relay parameter.
gh1Output (int)Index of the Grasshopper 1 output, which must also appear in the output map.
relay (Func<IParameter>)Factory for the relay parameter.
This rule, for chaining.

ViaOutput

#
public Gh1MigrationRule ViaOutput(int gh1Output, Guid aide, params (int gh1Input, int aideInput)[] feeds)
Send a mapped output through a MigrationAideComponent.
gh1Output (int)Index of the Grasshopper 1 output, which must also appear in the output map.
aide (Guid)IoId of the aide component.
feeds (params (int gh1Input, int aideInput)[])Grasshopper 1 inputs to fan out to the aide, with the aide inputs they feed.
This rule, for chaining.

WithExpression

#
public Gh1MigrationRule WithExpression(int gh2Input, string expression)
Post-process a Grasshopper 2 input with an expression, wrapping any existing one.
gh2Input (int)Index of the Grasshopper 2 input.
expression (string)Expression in x, such as x/2.
This rule, for chaining.

WithOutputExpression

#
public Gh1MigrationRule WithOutputExpression(int gh2Output, string expression)
Post-process a Grasshopper 2 output with an expression, applied before any existing one.
gh2Output (int)Index of the Grasshopper 2 output.
expression (string)Expression in x, such as x*255.
This rule, for chaining.

WithSortedOutput

#
public Gh1MigrationRule WithSortedOutput(int gh2Output)
Switch on the Sort modifier of a Grasshopper 2 output.
gh2Output (int)Index of the Grasshopper 2 output.
This rule, for chaining.

WithValue

#
public Gh1MigrationRule WithValue(int gh2Input, params object[] values)
Give an unmapped Grasshopper 2 input a starting value.
gh2Input (int)Index of the Grasshopper 2 input to set.
values (params object[])Values to place in the input.
This rule, for chaining.