Text fields

Text fields are a feature for text and leaders. Text fields are formulas that are evaluated while Rhino is running and the result is displayed in the text. All text fields are in the syntax of %<field and options>%. When a formula cannot be evaluated an error string of #### is displayed.

Area

Area of a closed curve, hatch, surface, or mesh.

Syntax:

%<area("id")>%

id is the guid of an existing object in the document.

BlockInstanceCount

Displays the number of blocks of the specified name.

Syntax:

%<blockinstancecount("apple")>%

displays the number of blocks named "apple" in the model.

CurveLength

Length of a curve.

Syntax:

%<curvelength("id")>%

id is the guid of an existing curve in the document.

Date

Current date.

Syntax:

%<date>%

%<date("format")>%

Text string examples

The date and time formats can be any of the following strings:

%<date("d")>% = 08/17/2000

%<date("D")>% = Thursday, August 17, 2000

%<date("f")>% = Thursday, August 17, 2000 16:32

%<date("F")>% = Thursday, August 17, 2000 16:32:32

%<date("g")>% = 08/17/2000 16:32

%<date("G")>% = 08/17/2000 16:32:32

%<date("m")>% = August 17

%<date("r")>% = Thu, 17 Aug 2000 23:32:32 GMT

%<date("s")>% = 2000-08-17T16:32:32

%<date("t")>% = 16:32

%<date("T")>% = 16:32:32

%<date("dddd, MMMM dd yyyy")>% = Thursday, August 17 2000

%<date("ddd, MMM d 'yy")>% = Thu, Aug 17 '00

%<date("dddd, MMMM dd")>% = Thursday, August 17

%<date("M/yy")>% = 8/00

%<date("dd-MM-yy")>% = 17-08-00

Note: The date and time may display differently based on Windows settings.

DateModified

Date this file was last saved.

Syntax:

Same as date.

DocumentText

Document text from the document.

Syntax:

%<documenttext("key")>%

key is the key for the DocumentText value to retrieve.

FileName

Path to the file.

Syntax:

%<filename>%

%<filename>% - creates the full path to the model

%<filename("0")>% - creates the full path to the model

%<filename("1")>% - short filename (includes file extension)

%<filename("2")>% - full path to model without file extension

%<filename("3")>% - short filename without extension

The number parameter is a mask to turn on certain features:

1 = short file name

2 = no extension

1+2 = 3 = short filename + no extension

ModelUnits

Active model units.

Syntax:

%<modelunits>%

Notes

Contents of the Notes.

Syntax:

%<notes>%

NumPages

Number of layout pages in the document.

Syntax:

%<numpages>%

ObjectName

Displays the object or block name if there is one.

Syntax:

%<objectname>%

PageName

Current layout name.

Syntax:

%<pagename>%

PageNumber

Current layout number.

Syntax:

%<pagenumber>%

UserText

Usertext for a given object / key combination.

Syntax:

%<usertext("id","key")>%

id is the guid of an existing object in the document.

key if the key of the UserText for the value to retrieve.


Rhinoceros 5 © 2010-2015 Robert McNeel & Associates. 17-Sep-2015