IGH_DocumentObject

References
public class IGH_DocumentObject
A wrapper around a dynamic Grasshopper 1.0 IGH_DocumentObject which exposes a bunch of common component and parameter properties in a strongly-typed way.

Constructors

IGH_DocumentObject

#
Create a new wrapper for a Grasshopper 1.0 document object.
public IGH_DocumentObject(
underlyingObject
An instance of a type which implements the Grasshopper.Kernel.IGH_DocumentObject 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; }

Bounds

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

ComponentId

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

Display

#
Gets the object preview of the underlying GH1 object, assuming this instance wraps an IGH_PreviewObject.
public ObjectDisplay Display { 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; }

Info

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

InstanceId

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

IsComponent

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

IsParameter

#
Gets whether this object wraps a Grasshopper 1.0 parameter.
public virtual bool IsParameter { get; }

Name

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

OutletPoint

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

UnderlyingObject

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

UserName

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

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.
)

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()

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
)

TransferObjectName

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

TransferObjectState

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