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

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

Properties

Activity

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

Bounds

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

ComponentId

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

Display

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

Expression

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

Icon

public Bitmap Icon { get; }
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.
inherited fromIGH_DocumentObject

Info

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

InstanceId

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

IsComponent

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

IsParameter

#
public override bool IsParameter { get; }

Modifiers

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

Name

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

OutletPoint

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

Reparameterize

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

SourceCount

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

SourceIds

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

TargetCount

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

UnderlyingObject

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

UserName

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

Methods

GetValue

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

Migrate

public IDocumentObject[] 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.
inherited fromIGH_DocumentObject

SetPersistent

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

Transfer

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

TransferExpression

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

TransferInstanceId

public void TransferInstanceId(IDocumentObject docObject)
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.
inherited fromIGH_DocumentObject
docObject (IDocumentObject)

TransferModifiers

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

TransferObjectName

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

TransferObjectState

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

TransferPersistentData

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

TransferWiring

#
public void TransferWiring(IParameter parameter)
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.
parameter (IParameter)