public sealed class IGH_Param : IGH_DocumentObject
A wrapper around an instance of the IGH_Param interface as defined in Grasshopper 1. This class exposes various common properties of GH1 parameters.

Constructors

IGH_Param

#
Create a new wrapper for a Grasshopper 1.0 parameter.
public IGH_Param(
underlyingObject
An instance of a type which implements the Grasshopper.Kernel.IGH_Param interface as defined in Grasshopper 1.
)

Properties

Activity

Gets the object activity of the underlying GH1 object, assuming this instance wraps an IGH_ActiveObject.
public ObjectActivity Activity { get; }
inherited fromIGH_DocumentObject

Bounds

Gets the bounds as per the attributes.
public RectangleF Bounds { get; }
inherited fromIGH_DocumentObject

ComponentId

Gets the type identifier of the underlying object.
public Guid ComponentId { get; }
inherited fromIGH_DocumentObject

Display

Gets the object preview of the underlying GH1 object, assuming this instance wraps an IGH_PreviewObject.
public ObjectDisplay Display { get; }
inherited fromIGH_DocumentObject

Expression

#
Gets the expression of the underlying object, assuming this instanc wraps an IGH_ExpressionParameter.
public string Expression { get; }

Icon

Gets the icon of the underlying object. Note that is is a relatively expensive process, as the icon needs to be converted from the GDI bitmap format into the ETO bitmap format.
public Bitmap Icon { get; }
inherited fromIGH_DocumentObject

Info

Gets the tooltip info of the underlying object.
public string Info { get; }
inherited fromIGH_DocumentObject

InstanceId

Gets the instance identifier the underlying object.
public Guid InstanceId { get; }
inherited fromIGH_DocumentObject

IsComponent

Gets whether this object wraps a Grasshopper 1.0 component.
public virtual bool IsComponent { get; }
inherited fromIGH_DocumentObject

IsParameter

#
public override bool IsParameter { get; }

Modifiers

#
Gets the modifiers of the underlying object, assuming this instance wraps an IGH_Param.
public Modifiers Modifiers { get; }

Name

Gets the name of the underlying object.
public string Name { get; }
inherited fromIGH_DocumentObject

OutletPoint

Gets the point wires leave this object from, as per the Grasshopper 1 attributes.
public PointF OutletPoint { get; }
inherited fromIGH_DocumentObject

Reparameterize

#
Gets whether the underlying object has its Reparameterize modifier enabled.
public bool Reparameterize { get; }

SourceCount

#
Gets the number of wires coming into this object, assuming this instance wraps an IGH_Param.
public int SourceCount { get; }

SourceIds

#
Try and get the IDs of the sources of this parameter.
public Guid[] SourceIds { get; }

TargetCount

#
Gets the number of wires coming out of this object, assuming this instance wraps an IGH_Param.
public int TargetCount { get; }

UnderlyingObject

Gets the hosted object.
public dynamic UnderlyingObject { get; }
inherited fromIGH_DocumentObject

UserName

Gets the nickname of the underlying object. In Grasshopper 2, this is called the UserName.
public string UserName { get; }
inherited fromIGH_DocumentObject

Methods

GetValue

Read a boolean option which Grasshopper 1 kept as a named value on the object.
public bool GetValue(
name,
Name of the value.
fallback
Value to return when the object has no such entry.
)
inherited fromIGH_DocumentObject

Migrate

Try and migrate this Grasshopper 1.0 object to one or more Grasshopper 2.0 objects. First a dedicated migrator will be attempted, and if that fails an interop wrapper object will be created. Default attributes will be created and the migrated object will be positioned and sized so that it best matches the source. If everything fails, nothing will happen and an empty array will be returned.
public IDocumentObject[] Migrate()
inherited fromIGH_DocumentObject

SetPersistent

#
Give a Grasshopper 2 parameter persistent values, whatever its type.
public static void SetPersistent(
parameter,
Parameter to set.
params object[]
values
Values to place at the root path.
)

Transfer

#
Copy all parameter relevant field over from the underlying parameter to the GH2 parameter.
public void Transfer(
parameter
)

TransferExpression

#
Copy the expression of this parameter into the GH2 parameter.
public void TransferExpression(
parameter
)

TransferInstanceId

Copy the instance ID of the Grasshopper 1 parameter into the CustomValues of the grasshopper 2 parameter. This is typically only used to recreate wires between parameters.
public void TransferInstanceId(
docObject
)
inherited fromIGH_DocumentObject

TransferModifiers

#
Copy the various data modifiers (but not the expression) of this parameter into the GH2 parameter.
public void TransferModifiers(
parameter
)

TransferObjectName

Copy the nickname of this object into the UserName of the given object.
public void TransferObjectName(
docObject
)
inherited fromIGH_DocumentObject

TransferObjectState

Copy the preview and enabled states from the underlying object into the GH2 object,
public void TransferObjectState(
docObject
)
inherited fromIGH_DocumentObject

TransferPersistentData

#
Copy the persistent data in this parameter into the GH2 parameter.
public void TransferPersistentData(
parameter
)

TransferWiring

#
Copy only the persistent data and the instance id of this parameter into the GH2 parameter, for relays which carry the wires while another parameter carries the modifiers.
public void TransferWiring(
parameter
)