GH_Variant
Variant data used in Grasshopper Expressions.
Inheritance Hierarchy
System.Object
Grasshopper.Kernel.Expressions.GH_Variant
Namespace: Grasshopper.Kernel.Expressions
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public class GH_Variant
The GH_Variant type exposes the following members.
Constructors
Name
Description
Public Method
GH_Variant.
Create a new Null variant.
Public Method
GH_Variant(Boolean)
Create a new Bool variant.
Public Method
GH_Variant(Complex)
Create a new Complex variant.
Public Method
GH_Variant(Double)
Create a new Double variant.
Public Method
GH_Variant(GH_Variant)
Duplicate a Variant.
Public Method
GH_Variant(Int32)
Create a new Integer variant.
Public Method
GH_Variant(Plane)
Create a new Plane variant.
Public Method
GH_Variant(Point3d)
Create a new Point variant.
Public Method
GH_Variant(String)
Create a new String variant.
Public Method
GH_Variant(Vector3d)
Create a new Point variant.
Properties
Name
Description
Public Property
_Bool
Gets the contents of this Variant as a bool.
Public Property
_Complex
Gets the contents of this Variant as a complex number.
Public Property
_Double
Gets the contents of this Variant as a double. If the Variant is of type Integer this cast will also work.
Public Property
_Int
Gets the contents of this Variant as an integer.
Public Property
_Plane
Gets the contents of this Variant as a Plane.
Public Property
_Point
Gets the contents of this Variant as a Point.
Public Property
_String
Gets the contents of this Variant as a String. This function will work for all Variant types.
Public Property
_Vector
Gets the contents of this Variant as a Vector.
Public Property
IsNumeric
Gets a value indicating whether or not the Variant is a numeric type. Only Doubles and Integers are considered to be Numeric.
Public Property
Type
Gets the Type of this Variant.
Methods
Name
Description
Public Method
Data.T.
Perform a straight cast of the data inside this Variant.
Public Method
Duplicate
Duplicate this Variant. If the type of this Variant is [unknown] the contents are not guaranteed to be duplicated.
Public Method
Evaluate
If this variant represents a string, this function will attempt to evaluate that string and replace the data inside this variant.
Public Method
ToGoo
Attempt to convert a Variant to a Grasshopper IGH_Goo type.
Public Method
ToString
(Overrides Object.ToString..)