GH_Format

public sealed class GH_Format
Provides standard Grasshopper formatting functions.

Methods

DefaultCulture

#
public static IFormatProvider DefaultCulture()

FormatAngularDimension

#
public static string FormatAngularDimension(GH_AngularDimension data)
data (GH_AngularDimension)

FormatAnnotationValidity

#
public static string FormatAnnotationValidity(AnnotationBase val, string identifier = "Annotation")
If the annotation is invalid, return a string describing why.
val (AnnotationBase)Value to format.
identifier (string = "Annotation")Name used to refer to the value in the format.
A string describing why the annotation is invalid or String.Empty if the value is not invalid.

FormatArc

#
public static string FormatArc(Arc data)
data (Arc)

FormatArc

#
public static string FormatArc(GH_Arc data)
data (GH_Arc)

FormatArcValidity

#
public static string FormatArcValidity(Arc val, string identifier = "Arc")
If the arc is invalid, return a string describing why.
val (Arc)Value to format.
identifier (string = "Arc")Name used to refer to the value in the format.
A string describing why the arc is invalid or String.Empty if the value is not invalid.

FormatBoolean

#
public static string FormatBoolean(bool data)
data (bool)

FormatBoolean

#
public static string FormatBoolean(GH_Boolean data)
data (GH_Boolean)

FormatBoundingBoxValidity

#
public static string FormatBoundingBoxValidity(BoundingBox val, string identifier = "Bounding Box")
If the box is invalid, return a string describing why.
val (BoundingBox)Value to format.
identifier (string = "Bounding Box")Name used to refer to the value in the format.
A string describing why the box is invalid or String.Empty if the value is not invalid.

FormatBox

#
public static string FormatBox(Box data)
data (Box)

FormatBox

#
public static string FormatBox(GH_Box data)
data (GH_Box)

FormatBoxValidity

#
public static string FormatBoxValidity(Box val, string identifier = "Box")
If the box is invalid, return a string describing why.
val (Box)Value to format.
identifier (string = "Box")Name used to refer to the value in the format.
A string describing why the box is invalid or String.Empty if the value is not invalid.

FormatBrep

#
public static string FormatBrep(Brep data)
data (Brep)

FormatBrep

#
public static string FormatBrep(GH_Brep data)
data (GH_Brep)

FormatBrepValidity

#
public static string FormatBrepValidity(Brep val, string identifier = "Brep")
If the brep is invalid, return a string describing why.
val (Brep)Value to format.
identifier (string = "Brep")Name used to refer to the value in the format.
A string describing why the brep is invalid or String.Empty if the value is not invalid.

FormatCentermark

#
public static string FormatCentermark(GH_Centermark data)
data (GH_Centermark)

FormatCircle

#
public static string FormatCircle(Circle data)
data (Circle)

FormatCircle

#
public static string FormatCircle(GH_Circle data)
data (GH_Circle)

FormatCircleValidity

#
public static string FormatCircleValidity(Circle val, string identifier = "Circle")
If the circle is invalid, return a string describing why.
val (Circle)Value to format.
identifier (string = "Circle")Name used to refer to the value in the format.
A string describing why the circle is invalid or String.Empty if the value is not invalid.

FormatClippingPlane

#
public static string FormatClippingPlane(GH_ClippingPlane data)
data (GH_ClippingPlane)

FormatClippingPlaneValidity

#
public static string FormatClippingPlaneValidity(ClippingPlaneSurface val, string identifier = "Clipping Plane")
If the clipping plane is invalid, return a string describing why.
val (ClippingPlaneSurface)Value to format.
identifier (string = "Clipping Plane")Name used to refer to the value in the format.
A string describing why the clipping plane is invalid or String.Empty if the value is not invalid.

FormatColour

#
public static string FormatColour(Color data)
data (Color)

FormatColour

#
public static string FormatColour(GH_Colour data)
data (GH_Colour)

FormatComplexNumber

#
public static string FormatComplexNumber(Complex num)
num (Complex)

FormatComplexNumber

#
public static string FormatComplexNumber(GH_ComplexNumber data)
data (GH_ComplexNumber)

FormatComplexValidity

#
public static string FormatComplexValidity(Complex val, string identifier = "Complex")
If the complex number is invalid, return a string describing why.
val (Complex)Value to format.
identifier (string = "Complex")Name used to refer to the value in the format.
A string describing why the complex number is invalid or String.Empty if the value is not invalid.

FormatCurve

#
public static string FormatCurve(Curve data, string prefix = "", string name = "Curve")
data (Curve)
prefix (string = "")
name (string = "Curve")

FormatCurve

#
public static string FormatCurve(GH_Curve data)
data (GH_Curve)

FormatCurveValidity

#
public static string FormatCurveValidity(Curve val, string identifier = "Curve")
If the curve is invalid, return a string describing why.
val (Curve)Value to format.
identifier (string = "Curve")Name used to refer to the value in the format.
A string describing why the curve is invalid or String.Empty if the value is not invalid.

FormatDate

#
public static string FormatDate(DateTime data)
data (DateTime)

FormatDate

#
public static string FormatDate(GH_Time data)
data (GH_Time)

FormatDetailView

#
public static string FormatDetailView(GH_DetailView data)
data (GH_DetailView)

FormatDetailViewValidity

#
public static string FormatDetailViewValidity(DetailView val, string identifier = "Detail View")
If the detail view is invalid, return a string describing why.
val (DetailView)Value to format.
identifier (string = "Detail View")Name used to refer to the value in the format.
A string describing why the detail view is invalid or String.Empty if the value is not invalid.

FormatDimension

#
public static string FormatDimension(GH_Dimension data)
data (GH_Dimension)

FormatDouble

#
public static string FormatDouble(double data)
data (double)

FormatDouble

#
public static string FormatDouble(GH_Number data)
data (GH_Number)

FormatDoubleValidity

#
public static string FormatDoubleValidity(double val, string identifier = "Number")
If the number is invalid, return a string describing why.
val (double)Value to format.
identifier (string = "Number")Name used to refer to the value in the format.
A string describing why the number is invalid or String.Empty if the value is not invalid.

FormatExtrusion

#
public static string FormatExtrusion(Extrusion data)
data (Extrusion)

FormatExtrusion

#
public static string FormatExtrusion(GH_Extrusion data)
data (GH_Extrusion)

FormatExtrusionValidity

#
public static string FormatExtrusionValidity(Extrusion val, string identifier = "Extrusion")
If the extrusion is invalid, return a string describing why.
val (Extrusion)Value to format.
identifier (string = "Extrusion")Name used to refer to the value in the format.
A string describing why the extrusion is invalid or String.Empty if the value is not invalid.

FormatFilePath

#
public static string FormatFilePath(string path, int maxLength)
Format a filepath so that it doesn't exceed a string length. If the filepath filename is already longer than maxLength it will be returned intact.
path (string)Path for format.
maxLength (int)Maximum number of characters to use.
The formatted path.

FormatFilePath

#
public static string FormatFilePath(string path, int maxWidth, Font font)
Format a filepath so that it doesn't exceed width. If the filepath filename is already longer than maxLength it will be returned intact.
path (string)Path to format.
maxWidth (int)Maximum allowed width (in pixels)
font (Font)Font to use for measuring.
The formatted path.

FormatGeometry

#
public static string FormatGeometry(IGH_GeometricGoo data)
data (IGH_GeometricGoo)

FormatHatch

#
public static string FormatHatch(GH_Hatch data)
data (GH_Hatch)

FormatHatchValidity

#
public static string FormatHatchValidity(Hatch val, string identifier = "Hatch")
If the hatch is invalid, return a string describing why.
val (Hatch)Value to format.
identifier (string = "Hatch")Name used to refer to the value in the format.
A string describing why the hatch is invalid or String.Empty if the value is not invalid.

FormatInstanceReference

#
public static string FormatInstanceReference(GH_InstanceReference data)
data (GH_InstanceReference)

FormatInstanceReferenceValidity

#
public static string FormatInstanceReferenceValidity(InstanceReferenceGeometry val, string identifier = "Instance Reference")
If the instance reference is invalid, return a string describing why.
val (InstanceReferenceGeometry)Value to format.
identifier (string = "Instance Reference")Name used to refer to the value in the format.
A string describing why the instance reference is invalid or String.Empty if the value is not invalid.

FormatInteger

#
public static string FormatInteger(GH_Integer data)
data (GH_Integer)

FormatInteger

#
public static string FormatInteger(int data)
data (int)

FormatInterval

#
public static string FormatInterval(double t0, double t1)
t0 (double)
t1 (double)

FormatInterval

#
public static string FormatInterval(GH_Interval data)
data (GH_Interval)

FormatInterval

#
public static string FormatInterval(GH_Interval2D data)
data (GH_Interval2D)

FormatInterval

#
public static string FormatInterval(Interval data)
data (Interval)

FormatIntervalValidity

#
public static string FormatIntervalValidity(Interval val, string identifier = "Domain", bool testSingleton = false, bool testDecreasing = false)
If the point is invalid, return a string describing why.
val (Interval)Value to format.
identifier (string = "Domain")Name used to refer to the value in the format.
testSingleton (bool = false)If true, Intervals that have no length are considered invalid.
testDecreasing (bool = false)If true, Intervals that are decreasing are considered invalid.
A string describing why the point is invalid or String.Empty if the value is not invalid.

FormatKeys

#
public static string FormatKeys(Keys keys)
Format a keys enumeration as though it's a menu shortcut
keys (Keys)Key data to format

FormatLeader

#
public static string FormatLeader(GH_Leader data)
data (GH_Leader)

FormatLightValidity

#
public static string FormatLightValidity(Light val, string identifier = "Light")
If the light is invalid, return a string describing why.
val (Light)Value to format.
identifier (string = "Light")Name used to refer to the value in the format.
A string describing why the light is invalid or String.Empty if the value is not invalid.

FormatLine

#
public static string FormatLine(GH_Line data)
data (GH_Line)

FormatLine

#
public static string FormatLine(Line data)
data (Line)

FormatLinearDimension

#
public static string FormatLinearDimension(GH_LinearDimension data)
data (GH_LinearDimension)

FormatLineValidity

#
public static string FormatLineValidity(Line val, string identifier = "Line")
If the line is invalid, return a string describing why.
val (Line)Value to format.
identifier (string = "Line")Name used to refer to the value in the format.
A string describing why the line is invalid or String.Empty if the value is not invalid.

FormatMatrix

#
public static string FormatMatrix(GH_Matrix data)
data (GH_Matrix)

FormatMatrix

#
public static string FormatMatrix(Matrix data)
data (Matrix)

FormatMesh

#
public static string FormatMesh(GH_Mesh data)
data (GH_Mesh)

FormatMesh

#
public static string FormatMesh(Mesh data, string sPrefix = "")
data (Mesh)
sPrefix (string = "")

FormatMeshFace

#
public static string FormatMeshFace(GH_MeshFace data)
data (GH_MeshFace)

FormatMeshFaceValidity

#
public static string FormatMeshFaceValidity(MeshFace val, string identifier = "MeshFace")
If the number is invalid, return a string describing why.
val (MeshFace)Value to format.
identifier (string = "MeshFace")Name used to refer to the value in the format.
A string describing why the point is invalid or String.Empty if the value is not invalid.

FormatMeshValidity

#
public static string FormatMeshValidity(Mesh val, string identifier = "Mesh")
If the mesh is invalid, return a string describing why.
val (Mesh)Value to format.
identifier (string = "Mesh")Name used to refer to the value in the format.
A string describing why the mesh is invalid or String.Empty if the value is not invalid.

FormatOrdinateDimension

#
public static string FormatOrdinateDimension(GH_OrdinateDimension data)
data (GH_OrdinateDimension)

FormatPlane

#
public static string FormatPlane(GH_Plane data)
data (GH_Plane)

FormatPlane

#
public static string FormatPlane(Plane data)
data (Plane)

FormatPlaneValidity

#
public static string FormatPlaneValidity(Plane val, string identifier = "Plane", bool testUnitAxes = false)
If the plane is invalid, return a string describing why.
val (Plane)Value to format.
identifier (string = "Plane")Name used to refer to the value in the format.
testUnitAxes (bool = false)If True, planes with non-unit axis vectors are considered to be invalid.
A string describing why the plane is invalid or String.Empty if the value is not invalid.

FormatPoint

#
public static string FormatPoint(GH_Point data)
data (GH_Point)

FormatPoint

#
public static string FormatPoint(Point3d data)
data (Point3d)

FormatPointCloud

#
public static string FormatPointCloud(GH_PointCloud data)
data (GH_PointCloud)

FormatPointCloud

#
public static string FormatPointCloud(PointCloud data, string prefix = "")
data (PointCloud)
prefix (string = "")

FormatPointCloud

#
public static string FormatPointCloud(PointCloud data)
data (PointCloud)

FormatPointCloudValidity

#
public static string FormatPointCloudValidity(PointCloud val, string identifier = "Point Cloud")
If the pointcloud is invalid, return a string describing why.
val (PointCloud)Value to format.
identifier (string = "Point Cloud")Name used to refer to the value in the format.
A string describing why the pointcloud is invalid or String.Empty if the value is not invalid.

FormatPointValidity

#
public static string FormatPointValidity(Point3d val, string identifier = "Point")
If the point is invalid, return a string describing why.
val (Point3d)Value to format.
identifier (string = "Point")Name used to refer to the value in the format.
A string describing why the point is invalid or String.Empty if the value is not invalid.

FormatRadialDimension

#
public static string FormatRadialDimension(GH_RadialDimension data)
data (GH_RadialDimension)

FormatRectangleValidity

#
public static string FormatRectangleValidity(Rectangle3d val, string identifier = "Rectangle")
If the rectangle is invalid, return a string describing why.
val (Rectangle3d)Value to format.
identifier (string = "Rectangle")Name used to refer to the value in the format.
A string describing why the rectangle is invalid or String.Empty if the value is not invalid.

FormatSingle

#
public static string FormatSingle(float data)
data (float)

FormatString

#
public static string FormatString(string text, params object[] args)
Replaces the format items in a string with the string representations of corresponding objects in a specified array.
Remarks: Formatting is done using invariant-culture formatting information.
text (string)A composite format string.
args (params object[])An object array that contains zero or more objects to format.
A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args.

FormatSubD

#
public static string FormatSubD(GH_SubD data)
data (GH_SubD)

FormatSubD

#
public static string FormatSubD(SubD data)
data (SubD)

FormatSubDValidity

#
public static string FormatSubDValidity(SubD val, string identifier = "SubD")
If the brep is invalid, return a string describing why.
val (SubD)Value to format.
identifier (string = "SubD")Name used to refer to the value in the format.
A string describing why the brep is invalid or String.Empty if the value is not invalid.

FormatSurface

#
public static string FormatSurface(Brep data)
data (Brep)

FormatSurface

#
public static string FormatSurface(GH_Surface data)
data (GH_Surface)

FormatSurfaceValidity

#
public static string FormatSurfaceValidity(Surface val, string identifier = "Surface")
If the surface is invalid, return a string describing why.
val (Surface)Value to format.
identifier (string = "Surface")Name used to refer to the value in the format.
A string describing why the surface is invalid or String.Empty if the value is not invalid.

FormatTextDot

#
public static string FormatTextDot(GH_TextDot data)
data (GH_TextDot)

FormatTextDotValidity

#
public static string FormatTextDotValidity(TextDot val, string identifier = "Text Dot")
If the text dot is invalid, return a string describing why.
val (TextDot)Value to format.
identifier (string = "Text Dot")Name used to refer to the value in the format.
A string describing why the text dot is invalid or String.Empty if the value is not invalid.

FormatTextEntity

#
public static string FormatTextEntity(GH_TextEntity data)
data (GH_TextEntity)

FormatTextEntity

#
public static string FormatTextEntity(TextEntity data, string prefix = "")
data (TextEntity)
prefix (string = "")

FormatTextEntity

#
public static string FormatTextEntity(TextEntity data)
data (TextEntity)

FormatTransformValidity

#
public static string FormatTransformValidity(Transform val, string identifier = "Transform")
If the transform is invalid, return a string describing why.
val (Transform)Value to format.
identifier (string = "Transform")Name used to refer to the value in the format.
A string describing why the transform is invalid or String.Empty if the value is not invalid.

FormatVector

#
public static string FormatVector(GH_Vector data)
data (GH_Vector)

FormatVector

#
public static string FormatVector(Vector3d data)
data (Vector3d)

FormatVectorValidity

#
public static string FormatVectorValidity(Vector3d val, string identifier = "Vector", bool testZero = false, bool testUnit = false)
If the point is invalid, return a string describing why.
val (Vector3d)Value to format.
identifier (string = "Vector")Name used to refer to the value in the format.
testZero (bool = false)If True, zero-length vectors are considered to be invalid.
testUnit (bool = false)If True, non-unit-length vectors are considered to be invalid.
A string describing why the point is invalid or String.Empty if the value is not invalid.

RhinoUnitName

#
public static string RhinoUnitName()

RhinoUnitName

#
public static string RhinoUnitName(UnitSystem unitSystem)
unitSystem (UnitSystem)

RhinoUnitSymbol

#
public static string RhinoUnitSymbol()

RhinoUnitSymbol

#
public static string RhinoUnitSymbol(UnitSystem unitSystem)
unitSystem (UnitSystem)

TreatAsCollection

#
public static bool TreatAsCollection(object obj)
This method is used in Scripting components to determine whether a certain class was 'intended' as a collection or as a single piece of data .
obj (object)Object to test.
True if we think the object was intended as a collection.

TryGetName

#
public static bool TryGetName(Color color, ref string name)
color (Color)
name (ref string)