GH_Convert
Provides static converters for different data types inside Grasshopper. This class both has specific and generic converters.
Fields
PureDateTicks
#Represents the total number of ticks past midnight that (by Grasshopper convention) identifies a pure date.
Properties
CultureTable
#Gets the cached culture table. Do not modify this dictionary unless you know what you are doing.
Methods
BackSolveExpression
#Try and backsolve an expression
public static bool BackSolveExpression()
exp,
Expression to back solve.
variable,
Name of input variable.
target,
Result to look for.
minimum,
Lowest input to try.
maximum,
Highest input to try.
steps,
Number of steps per iteration.
ref double
t,
Value for variable that closest approximates the target value.
ref double
v
Value of expression for the best approximation.
Returns: True on success, false on failure..
ByteArrayToCommonObject<T>
#Convert an OpenNurbs compliant compressed byte array into a RhinoCommon object.
Returns: A RhinoCommon object instance or null on failure.
CommonObjectToByteArray
#Convert a RhinoCommon object into a compressed byte-array using OpenNurbs serialization.
Returns: A byte array representing the object or null on failure.
CreatePureDate
#Convert a datetime structure into a pure date, i.e. remove the time portion. As per convention, this leaves 1 tick into the day in question intact.
CreatePureTime
#Convert a datetime structure into a pure time, i.e. remove the date portion. As per convention, this means setting the year, month and day to 1.
CreatePureTime
#Create a pure time instance. If the total number of hours, minutes and seconds exceeds a full year then it is not possible to create a pure time and the largest possible pure time will be returned instead.
FileToHash
#Create a hash of a file.
Returns: A hash of the file contents. File name and attributes are not taken into consideration.
FindRhinoObjectByNameAndType
#Search the current Rhino document for an object with a given name of a given type.
Returns: An object that matches the name + type filter or null if no object could be found.
GeometryToObjRef
#Create an ObjRef for a referenced IGH_GeometricGoo. Unreferenced IGH_GeometryGoo will return null.
Returns: An instance of an ObjRef when the goo is referenced geometry. It is up to the caller to Dispose of the objref when it is no longer needed Null for unreferenced geometry
GetBrepFromDocument
#Harvest a brep object from a Rhino document.
Returns: True on success, false on failure.
GetClippingPlaneFromDocument
#Harvest a clipping plane surface from a Rhino document.
Returns: True on success, false on failure.
GetCurveFromDocument
#Harvest a curve object from a Rhino document.
Returns: True on success, false on failure.
GetExtrusionFromDocument
#Harvest an extrusion object from a Rhino document.
Returns: True on success, false on failure.
GetMeshFromDocument
#Harvest a mesh object from a Rhino document.
Returns: True on success, false on failure.
GetPlaneFromDocument
#Harvest the object frame plane from a Rhino document.
Returns: True on success, false on failure.
GetPointFromDocument
#Harvest a point object from a Rhino document.
Returns: True on success, false on failure.
GetSubDFromDocument
#Harvest a sub-d object from a Rhino document.
Returns: True on success, false on failure.
GetSurfaceFromDocument
#Harvest a surface object from a Rhino document.
Returns: True on success, false on failure.
GetTimeKind
#Gets the kind of time implied by two System.DateTime values.
Returns: GH_TimeKind.PureTime, GH_TimeKind.PureDate or GH_TimeKind.DateAndTime if both kinds are the same. GH_TimeKind.DateAndTime is one is a pure date and the other a DateAndTime value. GH_TimeKind.Mixed is one is a pure time and the other one is not.
GetTimeKind
#Gets the kind of time implied by a System.DateTime value.
Returns: GH_TimeKind.PureTime, GH_TimeKind.PureDate or GH_TimeKind.DateAndTime.
IsPureDate
#Tests whether a DateTime instance represents a pure date (i.e. that the time portion is undefined). Pure dates are a Grasshopper convention, basically a pure date is 1 tick past midnight.
Returns: True if the date is considered pure.
IsPureTime
#Tests whether a DateTime instance represents a pure time (i.e. that the date portion is undefined). Pure times are a Grasshopper convention, basically a pure time is 2 ticks past any second.
Returns: True if the time is considered undefined.
ObjRefToGeometry
#Convert a Rhino Object Reference into Grasshopper IGH_GeometricGoo.
Returns: An instance that implements IGH_GeometricGoo on success or false on failure.
ParseExpression
#Attempts to parse an expression.
public static GH_Variant ParseExpression()
exp,
Expression to parse.
recursive
If True, and the result of the expression is a String, the result is parsed again until the result is no longer a String or until the expression fails.
Returns: The result of the (recursive) expression.
StringToDate
#Convert a string representing a date into an actual date. If a pure date is possible it will be returned. If the input is a pure time this method will fail, you need to use StringToTime instead.
Returns: True if string was successfully parsed, false if not.
StringToGuid
#Create a Guid based on SHA256 hashing of a string.
Returns: A guid representing the string.
StringToTime
#Convert a string representing a time into an pure time. Allowed separators of hour, minute and second portions are colons, semi-colons, points and commas. Grasshopper itself uses colons when formatting times. A PM or AM symbol is allowed provided it does not border on any alphabetical characters. A time can be prefixed by a "X day[s] + " string which defines the total number of 24-hour periods to include.
Returns: True if string was successfully parsed, false if not.
To_GH_ClassPrefixTypeName
#Rename a Type FullName from the pre-"GH_"-prefix ea.
Returns: The renamed typename.
ToAnnotationBase
#Convert data into Rhino.Geometry.AnnotationBase.
ToAnnotationBase_Primary
#Performs a direct cast from Rhino.Geometry.AnnotationBase or GH_AnnotationBase. Data is not guaranteed to be duplicated.
Returns: A AnnotationBase instance if successful, or Nothing on failure.
ToAnnotationBase_Secondary
#Attempts to convert other data types into an Rhino.Geometry.AnnotationBase. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.AnnotationBase instance if successful, or Nothing on failure.
ToArc_Primary
#Performs a direct cast from OnArc or GH_Arc. Data is not quaranteed to be duplicated.
Returns: An OnArc instance if successful, or Nothing on failure.
ToArc_Secondary
#Attempts to convert other data types into an OnArc. Data is not quaranteed to be duplicated.
Returns: An OnArc instance if successful, or Nothing on failure.
ToBoolean_Primary
#Performs a direct cast from boolean or GH_Boolean.
Returns: True on success, false on failure.
ToBoolean_Secondary
#Performs indirect casts from other data types into booleans.
Remarks: This converted relies on ToInt32_Secondary()
Returns: True on success, false on failure.
ToBoundingBox_Primary
#Performs a direct cast from OnBoundingBox. Data is not quaranteed to be duplicated.
Returns: An OnBoundingBox instance if successful, or Nothing on failure.
ToBox_Primary
#Performs a direct cast from Box. Data is not quaranteed to be duplicated.
Returns: An OnBoundingBox instance if successful, or Nothing on failure.
ToBrep_Primary
#Performs a direct cast from OnBrep or GH_Brep. Data is not quaranteed to be duplicated.
Returns: An OnBrep instance if successful, or Nothing on failure.
ToBrep_Secondary
#Attempts to convert other data types into an OnBrep. Data is not quaranteed to be duplicated.
Returns: An OnBrep instance if successful, or Nothing on failure.
ToCircle_Primary
#Performs a direct cast from OnCircle or GH_Circle. Data is not quaranteed to be duplicated.
Returns: An OnCircle instance if successful, or Nothing on failure.
ToCircle_Secondary
#Attempts to convert other data types into an OnCircle. Data is not quaranteed to be duplicated.
Returns: An OnCircle instance if successful, or Nothing on failure.
ToClippingPlane
#Convert data into Rhino.Geometry.ClippingPlaneSurface.
ToClippingPlane_Primary
#Performs a direct cast from Rhino.Geometry.ClippingPlaneSurface or GH_ClippingPlane. Data is not guaranteed to be duplicated.
Returns: A TextDot instance if successful, or Nothing on failure.
ToClippingPlane_Secondary
#Attempts to convert other data types into an Rhino.Geometry.ClippingPlaneSurface. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.ClippingPlaneSurface instance if successful, or Nothing on failure.
ToColor_Primary
#Performs a direct cast from Drawing.Color, GH_Color and OnColor.
Returns: True on success, false on failure.
ToColor_Secondary
#Performs indirect casts from other data types into Colors.
Returns: True on success, false on failure.
ToComplex
#Convert data into Complex.
ToComplex_Primary
#Performs a direct cast from Complex or GH_ComplexNumber
Returns: True on success, false on failure.
ToComplex_Secondary
#Performs indirect casts from other data types into Complex.
Returns: True on success, false on failure.
ToCoordinates
#ToCulture
#Convert data into Colors.
public static bool ToCulture()
ToCulture_Primary
#Performs a direct cast from System.Globalization.CultureInfo and GH_Culture.
Returns: True on success, false on failure.
ToCulture_Secondary
#Performs indirect casts from other data types into CultureInfo.
Returns: True on success, false on failure.
ToCurve_Primary
#Performs a direct cast from OnCurve or GH_Curve. Data is not quaranteed to be duplicated.
Returns: An OnCurve instance if successful, or Nothing on failure.
ToCurve_Secondary
#Attempts to convert other data types into an IOnCurve. Data is not quaranteed to be duplicated.
Returns: True on success, false on failure.
ToDate
#Convert data into Dates.
ToDate_Primary
#Performs a direct cast from DateTime or GH_DateTime.
Returns: True on success, false on failure.
ToDate_Secondary
#Performs indirect casts from other data types into DateTime constructs.
Returns: True on success, false on failure.
ToDimension_Primary
#Performs a direct cast from Rhino.Geometry.Dimension or GH_Dimension. Data is not guaranteed to be duplicated.
Returns: A Dimension instance if successful, or Nothing on failure.
ToDimension_Secondary
#Attempts to convert other data types into an Rhino.Geometry.Dimension. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.Dimension instance if successful, or Nothing on failure.
ToDouble_Primary
#Performs a direct cast from Double or GH_Number.
Returns: True on success, false on failure.
ToDouble_Secondary
#Performs indirect casts from other data types into Doubles.
Returns: True on success, false on failure.
ToExtrusion_Primary
#Performs a direct cast from Rhino.Geometry.Extrusion or GH_Extrusion. Data is not quaranteed to be duplicated.
Returns: An Extrusion instance if successful, or Nothing on failure.
ToExtrusion_Secondary
#Attempts to convert other data types into a Extrusion. Data is not quaranteed to be duplicated.
Returns: A Extrusion instance if successful, or Nothing on failure.
ToGeometricGoo
#Converts an object into GeometricGoo. Does not duplicate the data if a lossless conversion is possible.
Returns: An instance that implements IGH_GeometricGoo on success or null on failure.
ToGeometryBase
#Attempt to convert an object into a Rhino.Geometry.GeometryBase instance.
Returns: A GeometryBase instance on success or null on failure.
ToGHAngularDimension
#Convert data into GH_AngularDimension.
public static bool ToGHAngularDimension()
data,
Data to convert
conversion_level,
Level of conversion.
target
Destination of conversion. If Null, a new instance will be created.
ToGHAngularDimension_Primary
#Converts similar data into a GH_AngularDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHAngularDimension_Primary()
data,
Data to convert
target
Target instance. If null, a new GH_AngularDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHAngularDimension_Secondary
#Converts similar data into a GH_AngularDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHAngularDimension_Secondary()
data,
Data to convert
target
Target instance. If null, a new GH_AngularDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHAnnotationBase
#Convert data into GH_AnnotationBase.
public static bool ToGHAnnotationBase()
data,
Data to convert
conversion_level,
Level of conversion.
target
Destination of conversion. If Null, a new instance will be created.
ToGHArc
#Convert data into GH_Arcs.
ToGHArc_Primary
#Converts similar data into a GH_Arc instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHArc_Secondary
#Converts similar data into a GH_Arc instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHBoolean
#Convert data into GH_Boolean.
public static bool ToGHBoolean()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Boolean
target
Destination of conversion. If Null, a new instance will be created.
ToGHBoolean_Primary
#Converts similar data into a GH_Boolean instance. Data is not quaranteed to be duplicated.
public static bool ToGHBoolean_Primary()
data,
Data to convert
ref GH_Boolean
target
Target instance. If null, a new GH_Boolean will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHBoolean_Secondary
#Converts similar data into a GH_Boolean instance. Data is not quaranteed to be duplicated.
public static bool ToGHBoolean_Secondary()
data,
Data to convert
ref GH_Boolean
target
Target instance. If null, a new GH_Boolean will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHBox
#Convert data into GH_Boxes.
ToGHBox_Primary
#Converts similar data into a GH_Box instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHBox_Secondary
#Converts similar data into a GH_Box instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHBrep
#Convert data into GH_Breps.
ToGHBrep_Primary
#Converts similar data into a GH_Brep instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHBrep_Secondary
#Converts similar data into a GH_Brep instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHCentermark
#Convert data into GH_Centermark.
public static bool ToGHCentermark()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Centermark
target
Destination of conversion. If Null, a new instance will be created.
ToGHCentermark_Primary
#Converts similar data into a GH_Centermark instance. Data is not guaranteed to be duplicated.
public static bool ToGHCentermark_Primary()
data,
Data to convert
ref GH_Centermark
target
Target instance. If null, a new GH_Centermark will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHCentermark_Secondary
#Converts similar data into a GH_Centermark instance. Data is not guaranteed to be duplicated.
public static bool ToGHCentermark_Secondary()
data,
Data to convert
ref GH_Centermark
target
Target instance. If null, a new GH_Centermark will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHCircle
#Convert data into GH_Circles.
ToGHCircle_Primary
#Converts similar data into a GH_Circle instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHCircle_Secondary
#Converts similar data into a GH_Circle instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHClippingPlane
#Convert data into GH_ClippingPlane.
public static bool ToGHClippingPlane()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_ClippingPlane
target
Destination of conversion. If Null, a new instance will be created.
ToGHClippingPlane_Primary
#Converts similar data into a GH_ClippingPlane instance. Data is not guaranteed to be duplicated.
public static bool ToGHClippingPlane_Primary()
data,
Data to convert
ref GH_ClippingPlane
target
Target instance. If null, a new GH_ClippingPlane will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHClippingPlane_Secondary
#Converts similar data into a GH_Clipping instance. Data is not guaranteed to be duplicated.
public static bool ToGHClippingPlane_Secondary()
data,
Data to convert
ref GH_ClippingPlane
target
Target instance. If null, a new GH_ClippingPlane will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHColour
#Convert data into GH_Colour.
ToGHColour_Primary
#Converts similar data into a GH_Colour instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHColour_Secondary
#Converts similar data into a GH_Colour instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHComplexNumber
#Convert data into GH_ComplexNumber.
public static bool ToGHComplexNumber()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_ComplexNumber
target
Destination of conversion. If Null, a new instance will be created.
ToGHComplexNumber_Primary
#Converts similar data into a GH_ComplexNumber instance. Data is not quaranteed to be duplicated.
public static bool ToGHComplexNumber_Primary()
data,
Data to convert
ref GH_ComplexNumber
target
Target instance. If null, a new GH_ComplexNumber will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHComplexNumber_Secondary
#Converts similar data into a GH_ComplexNumber instance. Data is not quaranteed to be duplicated.
public static bool ToGHComplexNumber_Secondary()
data,
Data to convert
ref GH_ComplexNumber
target
Target instance. If null, a new GH_ComplexNumber will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHCurve
#Convert data into GH_Curves.
ToGHCurve_Primary
#Converts similar data into a GH_Curve instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHCurve_Secondary
#Converts similar data into a GH_Curve instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHDimension
#Convert data into GH_Dimension.
public static bool ToGHDimension()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Dimension
target
Destination of conversion. If Null, a new instance will be created.
ToGHExtrusion
#Convert data into GH_Extrusion.
public static bool ToGHExtrusion()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Extrusion
target
Destination of conversion. If Null, a new instance will be created.
ToGHExtrusion_Primary
#Converts similar data into a GH_Extrusion instance. Data is not quaranteed to be duplicated.
public static bool ToGHExtrusion_Primary()
data,
Data to convert
ref GH_Extrusion
target
Target instance. If null, a new GH_Brep will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHExtrusion_Secondary
#Converts similar data into a GH_Brep instance. Data is not quaranteed to be duplicated.
public static bool ToGHExtrusion_Secondary()
data,
Data to convert
ref GH_Extrusion
target
Target instance. If null, a new GH_Brep will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHGuid
#Convert data into GH_Guid.
ToGHGuid_Primary
#Converts similar data into a GH_Guid instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHGuid_Secondary
#Converts similar data into a GH_Guid instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHHatch
#Convert data into GH_Hatch.
ToGHHatch_Primary
#Converts similar data into a GH_Hatch instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHHatch_Secondary
#Converts similar data into a GH_Hatch instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHInstanceReference
#Convert data into GH_InstanceReference.
public static bool ToGHInstanceReference()
data,
Data to convert
conversion_level,
Level of conversion.
target
Destination of conversion. If Null, a new instance will be created.
ToGHInstanceReference_Primary
#Converts similar data into a GH_InstanceReference instance. Data is not guaranteed to be duplicated.
public static bool ToGHInstanceReference_Primary()
data,
Data to convert
target
Target instance. If null, a new GH_InstanceReference will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInstanceReference_Secondary
#Converts similar data into a GH_InstanceReference instance. Data is not guaranteed to be duplicated.
public static bool ToGHInstanceReference_Secondary()
data,
Data to convert
target
Target instance. If null, a new GH_InstanceReference will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInteger
#Convert data into GH_Integer.
public static bool ToGHInteger()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Integer
target
Destination of conversion. If Null, a new instance will be created.
ToGHInteger_Primary
#Converts similar data into a GH_Integer instance. Data is not quaranteed to be duplicated.
public static bool ToGHInteger_Primary()
data,
Data to convert
ref GH_Integer
target
Target instance. If null, a new GH_Integer will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInteger_Secondary
#Converts similar data into a GH_Integer instance. Data is not quaranteed to be duplicated.
public static bool ToGHInteger_Secondary()
data,
Data to convert
ref GH_Integer
target
Target instance. If null, a new GH_Integer will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInterval
#Convert data into GH_Intervals.
public static bool ToGHInterval()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Interval
target
Destination of conversion. If Null, a new instance will be created.
ToGHInterval_Primary
#Converts similar data into a GH_Interval instance. Data is not quaranteed to be duplicated.
public static bool ToGHInterval_Primary()
data,
Data to convert
ref GH_Interval
target
Target instance. If null, a new GH_Interval will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInterval_Secondary
#Converts similar data into a GH_Interval instance. Data is not quaranteed to be duplicated.
public static bool ToGHInterval_Secondary()
data,
Data to convert
ref GH_Interval
target
Target instance. If null, a new GH_Interval will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInterval2D
#Convert data into GH_Interval2Ds.
public static bool ToGHInterval2D()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Interval2D
target
Destination of conversion. If Null, a new instance will be created.
ToGHInterval2D_Primary
#Converts similar data into a GH_Interval2D instance. Data is not quaranteed to be duplicated.
public static bool ToGHInterval2D_Primary()
data,
Data to convert
ref GH_Interval2D
target
Target instance. If null, a new GH_Interval2D will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHInterval2D_Secondary
#Converts similar data into a GH_Interval2D instance. Data is not quaranteed to be duplicated.
public static bool ToGHInterval2D_Secondary()
data,
Data to convert
ref GH_Interval2D
target
Target instance. If null, a new GH_Interval2D will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHLeader
#Convert data into GH_Leader.
ToGHLeader_Primary
#Converts similar data into a GH_Leader instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHLeader_Secondary
#Converts similar data into a GH_Leader instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHLight
#Convert data into GH_Light.
ToGHLight_Primary
#Converts similar data into a GH_Light instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHLight_Secondary
#Converts similar data into a GH_Light instance. Data is not guaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHLine
#Convert data into GH_Lines.
ToGHLine_Primary
#Converts similar data into a GH_Line instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHLine_Secondary
#Converts similar data into a GH_Line instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHLinearDimension
#Convert data into GH_LinearDimension.
public static bool ToGHLinearDimension()
data,
Data to convert
conversion_level,
Level of conversion.
target
Destination of conversion. If Null, a new instance will be created.
ToGHLinearDimension_Primary
#Converts similar data into a GH_LinearDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHLinearDimension_Primary()
data,
Data to convert
target
Target instance. If null, a new GH_LinearDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHLinearDimension_Secondary
#Converts similar data into a GH_LinearDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHLinearDimension_Secondary()
data,
Data to convert
target
Target instance. If null, a new GH_LinearDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHMatrix
#Convert data into ToGHMatrix.
ToGHMatrix_Primary
#Converts similar data into a GH_Matrix instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHMatrix_Secondary
#Converts similar data into a GH_Matrix instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHMesh
#Convert data into GH_Meshs.
ToGHMesh_Primary
#Converts similar data into a GH_Mesh instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHMesh_Secondary
#Converts similar data into a GH_Mesh instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHMeshFace
#Convert data into GH_MeshFaces.
public static bool ToGHMeshFace()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_MeshFace
target
Destination of conversion. If Null, a new instance will be created.
ToGHMeshFace_Primary
#Converts similar data into a GH_MeshFace instance. Data is not quaranteed to be duplicated.
public static bool ToGHMeshFace_Primary()
data,
Data to convert
ref GH_MeshFace
target
Target instance. If null, a new GH_MeshFace will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHMeshFace_Secondary
#Converts similar data into a GH_MeshFace instance. Data is not quaranteed to be duplicated.
public static bool ToGHMeshFace_Secondary()
data,
Data to convert
ref GH_MeshFace
target
Target instance. If null, a new GH_MeshFace will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHNumber
#Convert data into GH_Number.
ToGHNumber_Primary
#Converts similar data into a GH_Number instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHNumber_Secondary
#Converts similar data into a GH_Number instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHOrdinateDimension
#Convert data into GH_OrdinateDimension.
public static bool ToGHOrdinateDimension()
data,
Data to convert
conversion_level,
Level of conversion.
target
Destination of conversion. If Null, a new instance will be created.
ToGHOrdinateDimension_Primary
#Converts similar data into a GH_OrdinateDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHOrdinateDimension_Primary()
data,
Data to convert
target
Target instance. If null, a new GH_OrdinateDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHOrdinateDimension_Secondary
#Converts similar data into a GH_OrdinateDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHOrdinateDimension_Secondary()
data,
Data to convert
target
Target instance. If null, a new GH_OrdinateDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHPlane
#Convert data into GH_Planes.
ToGHPlane_Primary
#Converts similar data into a GH_Plane instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHPlane_Secondary
#Converts similar data into a GH_Plane instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHPoint
#Convert data into GH_Points.
ToGHPoint_Primary
#Converts similar data into a GH_Point instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHPoint_Secondary
#Converts similar data into a GH_Point instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHPointCloud
#Convert data into GH_PointCloud.
public static bool ToGHPointCloud()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_PointCloud
target
Destination of conversion. If Null, a new instance will be created.
ToGHPointCloud_Primary
#Converts similar data into a GH_PointCloud instance. Data is not quaranteed to be duplicated.
public static bool ToGHPointCloud_Primary()
data,
Data to convert
ref GH_PointCloud
target
Target instance. If null, a new GH_PointCloud will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHPointCloud_Secondary
#Converts similar data into a GH_PointCloud instance. Data is not quaranteed to be duplicated.
public static bool ToGHPointCloud_Secondary()
data,
Data to convert
ref GH_PointCloud
target
Target instance. If null, a new GH_PointCloud will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHRadialDimension
#Convert data into GH_RadialDimension.
public static bool ToGHRadialDimension()
data,
Data to convert
conversion_level,
Level of conversion.
target
Destination of conversion. If Null, a new instance will be created.
ToGHRadialDimension_Primary
#Converts similar data into a GH_RadialDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHRadialDimension_Primary()
data,
Data to convert
target
Target instance. If null, a new GH_RadialDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHRadialDimension_Secondary
#Converts similar data into a GH_RadialDimension instance. Data is not guaranteed to be duplicated.
public static bool ToGHRadialDimension_Secondary()
data,
Data to convert
target
Target instance. If null, a new GH_RadialDimension will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHRectangle
#Convert data into GH_Rectangles.
public static bool ToGHRectangle()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Rectangle
target
Destination of conversion. If Null, a new instance will be created.
ToGHRectangle_Primary
#Converts similar data into a GH_Rectangle instance. Data is not quaranteed to be duplicated.
public static bool ToGHRectangle_Primary()
data,
Data to convert
ref GH_Rectangle
target
Target instance. If null, a new GH_Rectangle will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHRectangle_Secondary
#Converts similar data into a GH_Rectangle instance. Data is not quaranteed to be duplicated.
public static bool ToGHRectangle_Secondary()
data,
Data to convert
ref GH_Rectangle
target
Target instance. If null, a new GH_Rectangle will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHString
#Convert data into GH_String.
ToGHString_Primary
#Converts similar data into a GH_String instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHString_Secondary
#Converts similar data into a GH_String instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHSubD
#Convert data into GH_SubDs.
ToGHSubD_Primary
#Converts similar data into a GH_SubD instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHSubD_Secondary
#Converts similar data into a GH_SubD instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHSurface
#Convert data into GH_Surfaces.
public static bool ToGHSurface()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_Surface
target
Destination of conversion. If Null, a new instance will be created.
ToGHSurface_Primary
#Converts similar data into a GH_Surface instance. Data is not quaranteed to be duplicated.
public static bool ToGHSurface_Primary()
data,
Data to convert
ref GH_Surface
target
Target instance. If null, a new GH_Surface will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHSurface_Secondary
#Converts similar data into a GH_Surface instance. Data is not quaranteed to be duplicated.
public static bool ToGHSurface_Secondary()
data,
Data to convert
ref GH_Surface
target
Target instance. If null, a new GH_Surface will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHTextDot
#Convert data into GH_TextDot.
public static bool ToGHTextDot()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_TextDot
target
Destination of conversion. If Null, a new instance will be created.
ToGHTextDot_Primary
#Converts similar data into a GH_TextDot instance. Data is not guaranteed to be duplicated.
public static bool ToGHTextDot_Primary()
data,
Data to convert
ref GH_TextDot
target
Target instance. If null, a new GH_TextDot will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHTextDot_Secondary
#Converts similar data into a GH_TextDot instance. Data is not guaranteed to be duplicated.
public static bool ToGHTextDot_Secondary()
data,
Data to convert
ref GH_TextDot
target
Target instance. If null, a new GH_TextDot will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHTextEntity
#Convert data into GH_TextEntity.
public static bool ToGHTextEntity()
data,
Data to convert
conversion_level,
Level of conversion.
ref GH_TextEntity
target
Destination of conversion. If Null, a new instance will be created.
ToGHTextEntity_Primary
#Converts similar data into a GH_TextEntity instance. Data is not guaranteed to be duplicated.
public static bool ToGHTextEntity_Primary()
data,
Data to convert
ref GH_TextEntity
target
Target instance. If null, a new GH_TextEntity will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHTextEntity_Secondary
#Converts similar data into a GH_TextEntity instance. Data is not guaranteed to be duplicated.
public static bool ToGHTextEntity_Secondary()
data,
Data to convert
ref GH_TextEntity
target
Target instance. If null, a new GH_TextEntity will be constructed. If not null, the instance values will be set.
Returns: True on success, False on failure.
ToGHTime
#Convert data into GH_Time.
ToGHTime_Primary
#Converts similar data into a GH_Time instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHTime_Secondary
#Converts similar data into a GH_Time instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHVector
#Convert data into GH_Vectors.
ToGHVector_Primary
#Converts similar data into a GH_Vector instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGHVector_Secondary
#Converts similar data into a GH_Vector instance. Data is not quaranteed to be duplicated.
Returns: True on success, False on failure.
ToGoo
#Converts an object into Goo. Does not duplicate the data if a lossless conversion is possible.
Remarks: This function calls a whole sh*tload of other conversion functions. IT IS SLOW.
Returns: IGH_Goo instance. If Data is not a null reference this function ALWAYS returns a GOO instance.
ToGUID_Primary
#Performs a direct cast from Guid, GH_Guid, String and GH_String.
Returns: True on success, false on failure.
ToGUID_Secondary
#Performs indirect casts from other data types into Guids.
Returns: True on success, false on failure.
ToHatch_Primary
#Performs a direct cast from Rhino.Geometry.Hatch or GH_Hatch. Data is not guaranteed to be duplicated.
Returns: A Hatch instance if successful, or Nothing on failure.
ToHatch_Secondary
#Attempts to convert other data types into an Rhino.Geometry.Hatch. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.Hatch instance if successful, or Nothing on failure.
ToInt32_Primary
#Performs a direct cast from Int32 or GH_Integer.
Returns: True on success, false on failure.
ToInt32_Secondary
#Performs indirect casts from other data types into Integers.
Returns: True on success, false on failure.
ToInterval_Primary
#Performs a direct cast from OnInterval or GH_Interval.
Returns: True on success, false on failure.
ToInterval_Secondary
#Attempts to convert other data types into an Interval. Data is not quaranteed to be duplicated.
Returns: True on success, false on failure.
ToLeader_Primary
#Performs a direct cast from Rhino.Geometry.Leader or GH_Leader. Data is not guaranteed to be duplicated.
Returns: A Leader instance if successful, or Nothing on failure.
ToLeader_Secondary
#Attempts to convert other data types into an Rhino.Geometry.Leader. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.Leader instance if successful, or Nothing on failure.
ToLight_Secondary
#Attempts to convert other data types into an Rhino.Geometry.Light. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.Light instance if successful, or Nothing on failure.
ToLine_Primary
#Performs a direct cast from OnLine or GH_Line. Data is not quaranteed to be duplicated.
Returns: An OnLine instance if successful, or Nothing on failure.
ToLine_Secondary
#Attempts to convert other data types into an OnLine. Data is not quaranteed to be duplicated.
Returns: An OnLine instance if successful, or Nothing on failure.
ToMatrix_Primary
#Performs a direct cast from Matrix or GH_Matrix.
Returns: True on success, false on failure.
ToMatrix_Secondary
#Attempts to convert other data types into a Matrix. Data is not quaranteed to be duplicated.
Returns: True on success, false on failure.
ToMesh_Primary
#Performs a direct cast from Rhino.Geometry.Mesh or GH_Mesh. Data is not guaranteed to be duplicated.
Returns: A Mesh instance if successful, or Nothing on failure.
ToMesh_Secondary
#Attempts to convert other data types into an OnMesh. Data is not quaranteed to be duplicated.
Returns: An OnMesh instance if successful, or Nothing on failure.
ToNextPowerOfTen
#Round a number upwards to the nearest power of ten.
Returns: The power of ten equal to or higher than num.
ToPlane_Primary
#Performs a direct cast from OnPlane or GH_Plane. Data is not quaranteed to be duplicated.
Returns: An OnPlane instance if successful, or Nothing on failure.
ToPlane_Secondary
#Attempts to convert other data types into an OnPlane. Data is not quaranteed to be duplicated.
Returns: An OnPlane instance if successful, or Nothing on failure.
ToPlural
#Apply english rules to convert a noun into its plural form. This algorithm is not water-tight as it will not handle any irregular cases.
Returns: Plural form of noun.
ToPoint
#Convert a floating point GDI point structure to an integer rounded point.
public static Point ToPoint()
PointF
in
PointF to convert.
Returns: Integer accuracy point.
ToPoint3d_Primary
#Performs a direct cast from On3dPoint or GH_Point. Data is not quaranteed to be duplicated.
Returns: An On3dPoint instance if successful, or Nothing on failure.
ToPoint3d_Secondary
#Attempts to convert other data types into an Point. Data is not quaranteed to be duplicated.
Returns: True on success, false on failure.
ToPointCloud_Primary
#Performs a direct cast from Rhino.Geometry.PointCloud or GH_PointCloud. Data is not guaranteed to be duplicated.
Returns: A PointCloud instance if successful, or Nothing on failure.
ToPointCloud_Secondary
#Attempts to convert other data types into an Rhino.Geometry.PointCloud. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.PointCloud instance if successful, or Nothing on failure.
ToPointF
#Convert a Rhino SDK point structure to a GDI point structure.
Returns: Floating point accuracy GDI point.
ToPrevPowerOfTen
#Round a number downwards to the nearest power of ten.
Returns: The power of ten equal to or less than num.
ToRectangle
#Convert a floating point GDI rectangle structure to an integer rounded rectangle. Use this method for any and all GUI conversions as the specific rounding scheme used here avoids pixel jitter.
Returns: Integer accuracy rectangle.
ToRectangle3d_Primary
#Performs a direct cast from Rectangle3d or GH_Rectangle. Data is not quaranteed to be duplicated.
Returns: A Rectangle3d instance if successful, or Nothing on failure.
ToRectangle3d_Secondary
#Attempts to convert other data types into a Rectangle3d. Data is not quaranteed to be duplicated.
Returns: A Rectangle3d instance if successful, or Nothing on failure.
ToRelativePath
#Create a relative path from two absolute paths.
obsoleteDo not use this method, it is lame
Returns: The relative path on success or null on failure.
Exceptions:
| ArgumentNullException | Thrown if anchor_path is a null reference. |
| ArgumentNullException | Thrown if target_path is a null reference. |
ToSafeRhinoCommonObject
#Convert RhinoCommon types that are dangerous to use out of context (BrepFace, BrepEdge, etc.) into safe types (Brep, Curve, etc.).
Returns: Safe data.
ToSHA_Hash
#Create a SHA hash. The hash algorithm is only guaranteed to yield the same results from within a unique application domain.
Returns: A guid representing the (partial) SHA hash.
ToSHA_Hash
#Create a SHA hash. The hash algorithm is only guaranteed to yield the same results from within a unique application domain.
Returns: A guid representing the (partial) SHA hash.
ToSize
#Convert a floating point GDI size structure to an integer rounded size.
public static Size ToSize()
SizeF
in
SizeF to convert.
Returns: Integer accuracy size.
ToString_Primary
#Performs a direct cast from String and GH_String.
Returns: True on success, false on failure.
ToString_Secondary
#Creates a String representation of an object by calling the ToString() function.
Returns: True on success, false on failure.
ToSubD_Primary
#Performs a direct cast from OnSubD or GH_SubD. Data is not quaranteed to be duplicated.
Returns: An OnSubD instance if successful, or Nothing on failure.
ToSubD_Secondary
#Attempts to convert other data types into a Sub-D. Data is not quaranteed to be duplicated.
Returns: A Sub-D instance if successful, or Nothing on failure.
ToSurface_Primary
#Performs a direct cast from OnSurface or GH_Surface. Data is not quaranteed to be duplicated. If data is of type GH_Surface, then trim curves are ignored.
Returns: An OnSurface instance if successful, or Nothing on failure.
ToSurface_Secondary
#Attempts to convert other data types into an IOnSurface. Data is not quaranteed to be duplicated.
Returns: An IOnSurface instance if successful, or Nothing on failure.
ToTextDot_Primary
#Performs a direct cast from Rhino.Geometry.TextDot or GH_TextDot. Data is not guaranteed to be duplicated.
Returns: A TextDot instance if successful, or Nothing on failure.
ToTextDot_Secondary
#Attempts to convert other data types into an Rhino.Geometry.TextDot. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.TextDot instance if successful, or Nothing on failure.
ToTextEntity_Primary
#Performs a direct cast from Rhino.Geometry.TextEntity or GH_TextEntity. Data is not guaranteed to be duplicated.
Returns: A TextEntity instance if successful, or Nothing on failure.
ToTextEntity_Secondary
#Attempts to convert other data types into an Rhino.Geometry.TextEntity. Data is not quaranteed to be duplicated.
Returns: An Rhino.Geometry.TextEntity instance if successful, or Nothing on failure.
ToUVInterval
#Convert data into Grasshopper.Kernel.Types.UVInterval.
ToUVInterval_Primary
#Performs a direct cast from UVInterval or GH_Interval2D.
Returns: True on success, false on failure.
ToUVInterval_Secondary
#Attempts to convert other data types into a UVInterval. Data is not quaranteed to be duplicated.
Returns: True on success, false on failure.
ToVariableName
#Extract the implied variable name from a compound string. A string is considered compound if it contains a parenthesis pair with at least one character within the brackets.
Returns: The variable name as extracted or the original compound if no name was implied.
ToVariant
#Convert an object to a Grasshopper Expression Variant if possible.
Returns: An expression variant that matches the input best or a VAR_Null instance.
ToVector3d_Primary
#Performs a direct cast from On3dVector or GH_Vector. Data is not quaranteed to be duplicated.
Returns: An On3dVector instance if successful, or Nothing on failure.