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
Properties
Activity
Gets the object activity of the underlying GH1 object, assuming this instance wraps an IGH_ActiveObject.
Bounds
public RectangleF Bounds { get; }
Gets the bounds as per the attributes.
Display
Gets the object preview of the underlying GH1 object, assuming this instance wraps an IGH_PreviewObject.
Expression
#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.
IsComponent
Gets whether this object wraps a Grasshopper 1.0 component.
OutletPoint
public PointF OutletPoint { get; }
Gets the point wires leave this object from, as per the Grasshopper 1 attributes.
SourceCount
#Gets the number of wires coming into this object, assuming this instance wraps an IGH_Param.
TargetCount
#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.
UserName
Gets the nickname of the underlying object. In Grasshopper 2, this is called the UserName.
Methods
GetValue
Read a boolean option which Grasshopper 1 kept as a named value on the object.
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.
SetPersistent
#Give a Grasshopper 2 parameter persistent values, whatever its type.
Parameters:
| parameter (IParameter) | Parameter to set. |
| values (params object[]) | Values to place at the root path. |
Transfer
#Copy all parameter relevant field over from the underlying parameter to the GH2 parameter.
Parameters:
| parameter (IParameter) |
TransferExpression
#Copy the expression of this parameter into the GH2 parameter.
Parameters:
| parameter (IParameter) |
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.
Parameters:
| docObject (IDocumentObject) |
TransferModifiers
#Copy the various data modifiers (but not the expression) of this parameter into the GH2 parameter.
Parameters:
| parameter (IParameter) |
TransferObjectName
Copy the nickname of this object into the UserName of the given object.
Parameters:
| docObject (IDocumentObject) |
TransferObjectState
Copy the preview and enabled states from the underlying object into the GH2 object,
Parameters:
| docObject (IDocumentObject) |
TransferPersistentData
#Copy the persistent data in this parameter into the GH2 parameter.
Parameters:
| parameter (IParameter) |
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.
Parameters:
| parameter (IParameter) |