GH_UpgradeUtil.SwapComponents Method (IGH_Component, Guid, Boolean)

GH_UpgradeUtilSwapComponents Method (IGH_Component, Guid, Boolean)

Replace an existing component with a different one. All parameters (input and output) will be migrated.

Namespace:  Grasshopper.Kernel
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
public static IGH_Component SwapComponents(
	IGH_Component oldComponent,
	Guid newComponentGuid,
	bool migrateParameters
)
Public Shared Function SwapComponents ( 
	oldComponent As IGH_Component,
	newComponentGuid As Guid,
	migrateParameters As Boolean
) As IGH_Component

Parameters

oldComponent
Type: Grasshopper.KernelIGH_Component
Component current in a GH_Document.
newComponentGuid
Type: SystemGuid
ComponentGuid of the component to add.
migrateParameters
Type: SystemBoolean
If true, all parameters will be moved from old to new.

Return Value

Type: IGH_Component
Component that was added.
See Also