GH_UpgradeUtil

public class GH_UpgradeUtil
Exposes several utility functions for migrating parameters and wires between components useful while upgrading components.

Methods

MigrateInputParameters

#
Migrate a bunch of input parameters.
public static bool MigrateInputParameters(
source,
Source component.
target,
Target component.
int[]
index0,
List of input indices to migrate.
int[]
index1
Matching list of target indices.
)
True on success, false on failure.

MigrateInputParameters

#
Migrate all input parameters.
public static bool MigrateInputParameters(
source,
Source component.
target
Target component.
)
True on success, false on failure.

MigrateOutputParameters

#
Migrate a bunch of output parameters.
public static bool MigrateOutputParameters(
source,
Source component.
target,
Target component.
int[]
index0,
List of output indices to migrate.
int[]
index1
Matching list of target indices.
)
True on success, false on failure.

MigrateOutputParameters

#
Migrate all output parameters.
public static bool MigrateOutputParameters(
source,
Source component.
target
Target component.
)
True on success, false on failure.

MigrateRecipients

#
Utility method for bulk assigning a bunch of sources.
public static int MigrateRecipients(
recipients,
target
)

MigrateRecipients

#
Migrate all recipients from A to B, while maintaining order.
public static int MigrateRecipients(
from,
Parameter to move recipients from.
to
Parameter to move recipients to.
)
Number of recipients migrated.

MigrateSources

#
Utility method for bulk assigning a bunch of sources.
public static int MigrateSources()

MigrateSources

#
Migrate all sources from A to B, while maintaining order.
public static int MigrateSources(
from,
Parameter to move sources from.
to
Parameter to move sources to.
)
Number of sources migrated.

ReplaceInputParameters

#
Move all input parameters from one component to another. Only use this function if the target component can handle the input layout of the source component.
public static void ReplaceInputParameters(
source,
Component to move parameters from.
target
Component to move parameters to.
)

ReplaceOutputParameters

#
Move all output parameters from one component to another. Only use this function if the target component can handle the output layout of the source component.
public static void ReplaceOutputParameters(
source,
Component to move parameters from.
target
Component to move parameters to.
)

SwapComponents

#
Replace an existing component with a different one. All parameters (input and output) will be migrated.
public static bool SwapComponents(
oldComponent,
Component current in a GH_Document.
newComponent,
Component to swap.
migrateParameters
If true, all parameters will be moved from old to new.
)
True on success, false on failure.

SwapComponents

#
Replace an existing component with a different one. All parameters (input and output) will be migrated.
public static bool SwapComponents(
oldComponent,
Component current in a GH_Document.
newComponent
Component to swap.
)
True on success, false on failure.

SwapComponents

#
Replace an existing component with a different one. All parameters (input and output) will be migrated.
public static IGH_Component SwapComponents(
oldComponent,
Component current in a GH_Document.
newComponentGuid,
ComponentGuid of the component to add.
migrateParameters
If true, all parameters will be moved from old to new.
)
Component that was added.

SwapComponents

#
Replace an existing component with a different one. All parameters (input and output) will be migrated.
public static IGH_Component SwapComponents(
oldComponent,
Component current in a GH_Document.
newComponentGuid
ComponentGuid of the component to add.
)
Component that was added.