Click or drag to resize

GH_Variant Class

Variant data used in Grasshopper Expressions.
Inheritance Hierarchy
SystemObject
  Grasshopper.Kernel.ExpressionsGH_Variant

Namespace:  Grasshopper.Kernel.Expressions
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
public class GH_Variant

The GH_Variant type exposes the following members.

Constructors
  NameDescription
Public methodGH_Variant
Create a new Null variant.
Public methodGH_Variant(Plane)
Create a new Plane variant.
Public methodGH_Variant(Point3d)
Create a new Point variant.
Public methodGH_Variant(Vector3d)
Create a new Point variant.
Public methodGH_Variant(Boolean)
Create a new Bool variant.
Public methodGH_Variant(Double)
Create a new Double variant.
Public methodGH_Variant(Int32)
Create a new Integer variant.
Public methodGH_Variant(String)
Create a new String variant.
Public methodGH_Variant(Complex)
Create a new Complex variant.
Public methodGH_Variant(GH_Variant)
Duplicate a Variant.
Top
Properties
  NameDescription
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 propertyIsNumeric
Gets a value indicating whether or not the Variant is a numeric type. Only Doubles and Integers are considered to be Numeric.
Public propertyType
Gets the Type of this Variant.
Top
Methods
  NameDescription
Public methodDataT
Perform a straight cast of the data inside this Variant.
Public methodDuplicate
Duplicate this Variant. If the type of this Variant is [unknown] the contents are not guaranteed to be duplicated.
Public methodEvaluate
If this variant represents a string, this function will attempt to evaluate that string and replace the data inside this variant.
Public methodToGoo
Attempt to convert a Variant to a Grasshopper IGH_Goo type.
Public methodToString (Overrides ObjectToString.)
Top
See Also