Gh1MigrationRule

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

Constructors

Gh1MigrationRule

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

Properties

Grasshopper1Id

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

Grasshopper2Id

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

Methods

AngleInput

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

AngleOutput

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

Dropping

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

IMigrateComponent.Migrate

#
Migrate

HidingOutput

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

Identity

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

ShowingOutput

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

ViaInput

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

ViaOutput

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

ViaOutput

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

WithExpression

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

WithOutputExpression

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

WithSortedOutput

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

WithValue

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