TextFields

public static class TextFields
This Class Processes Text Field Functions

Methods

Area

#Since v7.0
Returns the area value for a selected object id in a specified unit system
public static double Area(
id,
unitSystem
)

Area

#Since v7.0
Returns the area value for a selected object id
public static double Area()

BlockAttributeText

#Since v7.0
User text associated with a block
public static string BlockAttributeText(
key,
prompt,
defaultValue
)

BlockDescription

#Since v8.0
Returns a block definition description
public static string BlockDescription(
definitionNameOrId
)

BlockInsertionCoordinate

#Since v9.0
Returns the insertion coordinate of a block instance. If the field is being evaluated from text inside a block instance, the immediate parent block instance is used.
public static string BlockInsertionCoordinate(
blockId,
axis
)

BlockInstanceCount

#Since v7.0
Returns the number of block instances found in the document with the specified block definition name or the instance reference id.
public static int BlockInstanceCount(
instanceDefinitionNameOrId
)

BlockInstanceName

#Since v7.0
Returns the block definition name of a block instance Use BlockName Instead
public static string BlockInstanceName(
blockId
)

BlockName

#Since v8.0
Returns the block definition name of a block instance
public static string BlockName(
blockId
)

CurveLength

#Since v7.0
Get length of a curve given a string id in a specified unit system. UnitSystem enumeration as string
public static double CurveLength(
id,
unitSystem
)

CurveLength

#Since v7.0
Get length of a curve given a string id
public static double CurveLength()

Date

#Since v7.0
Current date
public static string Date()

Date

#Since v7.0
Current Date in a specific format and language
public static string Date(
dateFormat,
languageId
)

Date

#Since v7.0
Current date in a specified format
public static string Date(
dateFormat
)

DateModified

#Since v7.0
Date the document was last edited
public static string DateModified()

DateModified

#Since v7.0
Date the document was last edited in a specific format and language in local time
public static string DateModified(
dateFormat,
languageId
)

DateModified

#Since v7.0
Date the document was last edited in a specified format
public static string DateModified(
dateFormat
)

DetailScale

#Since v7.0
Returns a detail views scale
public static string DetailScale(
detailId,
scaleFormat
)

DimValue

#Since v9.0
Returns the measured value of a dimension formatted with the named annotation style.
public static string DimValue(
dimensionId,
styleNameOrId
)

DimValue

#Since v9.0
Returns the measured value of a dimension formatted with the dimension's own annotation style.
public static string DimValue(
dimensionId
)

DocumentText

#Since v7.0
Return document user string for a given key
public static string DocumentText(
key
)

FileName

#Since v7.0
Return full path to the document
public static string FileName()

FileName

#Since v7.0
Return path to the document
public static string FileName(
options
)

GetInstanceAttributeFields

#Since v7.0
public static TextFields.InstanceAttributeField[] GetInstanceAttributeFields()

GetInstanceAttributeFields

#Since v7.0
Gets an array of block attribute definitions associated with a TextObject.
public static TextFields.InstanceAttributeField[] GetInstanceAttributeFields(
str
TextObject to check for block attribute definitions
)
Will return a empty array if text is null or there is no attributes otherwise; returns a list of one or more attribute definitions embedded in the text string.

GetInstanceAttributeFields

#Since v7.0
Gets an array of block attribute definitions associated with a TextObject.
public static TextFields.InstanceAttributeField[] GetInstanceAttributeFields(
text
TextObject to check for block attribute definitions
)
Will return a empty array if text is null or there is no attributes otherwise; returns a list of one or more attribute definitions embedded in the text string.

LayerName

#Since v7.0
Returns the name of a layer based on the layers guid
public static string LayerName(
layerId
)

LayoutUserText

#Since v7.0
Returns a value from the active layouts user text strings for the specified key.
public static string LayoutUserText(
key
)

LayoutUserText

#Since v7.0
Returns user text value from a layout id Key
public static string LayoutUserText(
layoutId,
key
)

ModelUnits

#Since v7.0
public static string ModelUnits()

Notes

#Since v7.0
Notes for a RhinoDoc
public static string Notes()

NumPages

#Since v7.0
Number of layout pages in a document
public static int NumPages()

ObjectLayer

#Since v7.0
Return an object's layer name
public static string ObjectLayer()

ObjectName

#Since v7.5
Returns an attached Text objects attribute name.
public static string ObjectName()

ObjectName

#Since v7.0
Return an object's name
public static string ObjectName()

ObjectPageName

#Since v8.0
Returns the layout page name the object resides on
public static string ObjectPageName()

ObjectPageNumber

#Since v8.0
Returns the layout page number the object resides on
public static int ObjectPageNumber()

PageHeight

#Since v7.0
Return the current layout page height in the layout units
public static double PageHeight()

PageName

#Since v7.0
Return the current layout page name
public static string PageName()

PageName

#Since v7.0
Return the page name for the specified View ID
public static string PageName()

PageNumber

#Since v7.0
Returns the current layouts page number
public static int PageNumber()

PageWidth

#Since v7.0
Return the current layout page width in the layout units
public static double PageWidth()

PaperName

#Since v7.0
Returns the layouts selected paper name example Letter / A4 / A6
public static string PaperName()

PointCoordinate

#Since v7.0
returns the location of a 3d point
public static string PointCoordinate(
pointId,
axis
)

TryFormat

#Since v8.0
Formats the contents of a text string with field expressions and returns the result.

The text is evaluated with no object context, which suits fields that read only the document, such as Date or ModelUnits. Fields that read the object itself or the block instance enclosing it - user text, for example - cannot resolve this way and will come back empty; use the overload that takes the object and its parents for those.

public static bool TryFormat(
text,
The text formula to format
doc,
The Rhino document to evaluate
out string
result
The result of the formatted expression. Otherwise, if the text is null or the evaluation process fails, the result will be empty.
)
Returns True if the expression is formatted properly; Otherwise False.

TryFormat

#Since v9.0
Formats the contents of a text string with field expressions and returns the result, evaluating it against a specific object and the block instances that enclose it.
public static bool TryFormat(
text,
The text formula to format
doc,
The Rhino document to evaluate
obj,
The object the text belongs to, or null. Fields that read the object itself, such as its user text, need this.
topParent,
The top level object the text belongs to, or null to use obj.
immediateParent,
The block instance directly containing obj, or null. Fields that read user text off the enclosing instance need this.
out string
result
The result of the formatted expression. Otherwise, if the text is null or the evaluation process fails, the result will be empty.
)
Returns True if the expression is formatted properly; Otherwise False.

TryParse

#Since v8.0
Evaluates the contents of a text string with field expressions and returns the result
public static bool TryParse(
text,
The text formula to parse and evaluate
doc,
The Rhino document to evaluate
out List<string>
result
The result of the evaluated expression. Otherwise, if the text is null or the evaluation process fails, the result will be empty.
)
Returns True if the expression is evaluated properly; Otherwise False.

UserText

#Since v7.0
User text associated with an object, block or layout
public static string UserText(
id,
key,
prompt,
defaultValue
)

UserText

#Since v7.0
User text associated with an object, block or layout
public static string UserText(
id,
key,
prompt
)

UserText

#Since v7.0
User text associated with an object, block or layout
public static string UserText(
id,
key
)

Volume

#Since v7.0
Returns a volume; if the opt param is a bool "true/false" or "1/0" then open objects are inspected or ignored. if the opt param is a unit system as a string "millimeter" then the volume will be returned if the object is closed and in the specified unit system. Open objects return 0
public static double Volume(
id,
opt
)

Volume

#Since v7.8
Returns a volume from an object Id. If allowOpenObjects = false objects which are open will return 0.0 as a volume.
public static double Volume(
id,
unitSystem,
allowOpenObjects
)

Volume

#Since v7.0
Returns the volume for the selected object id open objects return 0 volume
public static double Volume()