TextFields

public static class TextFields
This Class Processes Text Field Functions

Methods

Area

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

Area

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

BlockAttributeText

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

BlockDescription

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

BlockInsertionCoordinate

#Since v9.0
public static string BlockInsertionCoordinate(string blockId, string axis)
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.
blockId (string)
axis (string)

BlockInstanceCount

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

BlockInstanceName

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

BlockName

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

CurveLength

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

CurveLength

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

Date

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

Date

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

Date

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

DateModified

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

DateModified

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

DateModified

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

DetailScale

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

DimValue

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

DimValue

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

DocumentText

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

FileName

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

FileName

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

GetInstanceAttributeFields

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

GetInstanceAttributeFields

#Since v7.0
public static TextFields.InstanceAttributeField[] GetInstanceAttributeFields(string str)
Gets an array of block attribute definitions associated with a TextObject.
str (string)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
public static TextFields.InstanceAttributeField[] GetInstanceAttributeFields(TextObject text)
Gets an array of block attribute definitions associated with a TextObject.
text (TextObject)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
public static string LayerName(string layerId)
Returns the name of a layer based on the layers guid
layerId (string)

LayoutUserText

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

LayoutUserText

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

ModelUnits

#Since v7.0
public static string ModelUnits()

Notes

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

NumPages

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

ObjectLayer

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

ObjectName

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

ObjectName

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

ObjectPageName

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

ObjectPageNumber

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

PageHeight

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

PageName

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

PageName

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

PageNumber

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

PageWidth

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

PaperName

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

PointCoordinate

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

TryFormat

#Since v8.0
public static bool TryFormat(string text, RhinoDoc doc, out string result)
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.

text (string)The text formula to format
doc (RhinoDoc)The Rhino document to evaluate
result (out string)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
public static bool TryFormat(string text, RhinoDoc doc, RhinoObject obj, RhinoObject topParent, InstanceObject immediateParent, out string result)
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.
text (string)The text formula to format
doc (RhinoDoc)The Rhino document to evaluate
obj (RhinoObject)The object the text belongs to, or null. Fields that read the object itself, such as its user text, need this.
topParent (RhinoObject)The top level object the text belongs to, or null to use obj.
immediateParent (InstanceObject)The block instance directly containing obj, or null. Fields that read user text off the enclosing instance need this.
result (out string)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
public static bool TryParse(string text, RhinoDoc doc, out List<string> result)
Evaluates the contents of a text string with field expressions and returns the result
text (string)The text formula to parse and evaluate
doc (RhinoDoc)The Rhino document to evaluate
result (out List<string>)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
public static string UserText(string id, string key, string prompt, string defaultValue)
User text associated with an object, block or layout
id (string)
key (string)
prompt (string)
defaultValue (string)

UserText

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

UserText

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

Volume

#Since v7.0
public static double Volume(string id, string opt)
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
id (string)
opt (string)

Volume

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

Volume

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