GH_Format
public sealed class GH_Format
Provides standard Grasshopper formatting functions.
Methods
DefaultCulture
#FormatAnnotationValidity
#If the annotation is invalid, return a string describing why.
Parameters:
| val (AnnotationBase) | Value to format. |
| identifier (string = "Annotation") | Name used to refer to the value in the format. |
Returns: A string describing why the annotation is invalid or String.Empty if the value is not invalid.
FormatArcValidity
#If the arc is invalid, return a string describing why.
FormatBoundingBoxValidity
#If the box is invalid, return a string describing why.
Parameters:
| val (BoundingBox) | Value to format. |
| identifier (string = "Bounding Box") | Name used to refer to the value in the format. |
Returns: A string describing why the box is invalid or String.Empty if the value is not invalid.
FormatBoxValidity
#If the box is invalid, return a string describing why.
FormatBrepValidity
#If the brep is invalid, return a string describing why.
FormatCircleValidity
#If the circle is invalid, return a string describing why.
FormatClippingPlaneValidity
#public static string FormatClippingPlaneValidity(ClippingPlaneSurface val, string identifier = "Clipping Plane")
If the clipping plane is invalid, return a string describing why.
Parameters:
| val (ClippingPlaneSurface) | Value to format. |
| identifier (string = "Clipping Plane") | Name used to refer to the value in the format. |
Returns: A string describing why the clipping plane is invalid or String.Empty if the value is not invalid.
FormatComplexValidity
#If the complex number is invalid, return a string describing why.
FormatCurve
#FormatCurveValidity
#If the curve is invalid, return a string describing why.
FormatDetailViewValidity
#If the detail view is invalid, return a string describing why.
Parameters:
| val (DetailView) | Value to format. |
| identifier (string = "Detail View") | Name used to refer to the value in the format. |
Returns: A string describing why the detail view is invalid or String.Empty if the value is not invalid.
FormatDoubleValidity
#If the number is invalid, return a string describing why.
FormatExtrusionValidity
#If the extrusion is invalid, return a string describing why.
FormatFilePath
#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.
FormatFilePath
#Format a filepath so that it doesn't exceed width. If the filepath filename is already longer than maxLength it will be returned intact.
FormatHatchValidity
#If the hatch is invalid, return a string describing why.
FormatInstanceReferenceValidity
#public static string FormatInstanceReferenceValidity(InstanceReferenceGeometry val, string identifier = "Instance Reference")
If the instance reference is invalid, return a string describing why.
Parameters:
| val (InstanceReferenceGeometry) | Value to format. |
| identifier (string = "Instance Reference") | Name used to refer to the value in the format. |
Returns: A string describing why the instance reference is invalid or String.Empty if the value is not invalid.
FormatInterval
#FormatIntervalValidity
#If the point is invalid, return a string describing why.
Parameters:
| 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. |
Returns: A string describing why the point is invalid or String.Empty if the value is not invalid.
FormatKeys
#Format a keys enumeration as though it's a menu shortcut
Parameters:
| keys (Keys) | Key data to format |
FormatLightValidity
#If the light is invalid, return a string describing why.
FormatLineValidity
#If the line is invalid, return a string describing why.
FormatMesh
#FormatMeshFaceValidity
#If the number is invalid, return a string describing why.
FormatMeshValidity
#If the mesh is invalid, return a string describing why.
FormatPlaneValidity
#If the plane is invalid, return a string describing why.
Parameters:
| 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. |
Returns: A string describing why the plane is invalid or String.Empty if the value is not invalid.
FormatPointCloudValidity
#If the pointcloud is invalid, return a string describing why.
Parameters:
| val (PointCloud) | Value to format. |
| identifier (string = "Point Cloud") | Name used to refer to the value in the format. |
Returns: A string describing why the pointcloud is invalid or String.Empty if the value is not invalid.
FormatPointValidity
#If the point is invalid, return a string describing why.
FormatRectangleValidity
#If the rectangle is invalid, return a string describing why.
Parameters:
| val (Rectangle3d) | Value to format. |
| identifier (string = "Rectangle") | Name used to refer to the value in the format. |
Returns: A string describing why the rectangle is invalid or String.Empty if the value is not invalid.
FormatString
#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.
Parameters:
| text (string) | A composite format string. |
| args (params object[]) | An object array that contains zero or more objects to format. |
Returns: A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args.
FormatSubDValidity
#If the brep is invalid, return a string describing why.
FormatSurfaceValidity
#If the surface is invalid, return a string describing why.
FormatTextDotValidity
#If the text dot is invalid, return a string describing why.
FormatTransformValidity
#If the transform is invalid, return a string describing why.
FormatVectorValidity
#If the point is invalid, return a string describing why.
Parameters:
| 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. |
Returns: A string describing why the point is invalid or String.Empty if the value is not invalid.