Use format functions in value fields

Tekla Structures
2021
Tekla Structures

Use format functions in value fields

You can define the format used in a value field in two ways: In the Value Field Properties dialog box by filling in the fields for Datatype, Meaning, Unit and Decimals, or by creating a formula in the Formula field. In formulas, you can use the format function that converts an attribute value to a formatted information string.

When you use a format function in a formula, always set the Datatype to Text in the Value Field Properties dialog box. Leave the other fields in the Format area empty.

For example, if you want to convert the attribute value to numbers with decimals in the report, you need to include the conversion function double in the format function:

The default values for unit and decimals are defined in the contentattributes_global.lst file. The format function converts the attribute value to a formatted information string on the basis of what you have defined in the format function. The format function overrides the definitions in the contentattributes_global.lst file and settings that you have defined in the Format area of Value Field Properties dialog box.

Example of the result in a report when you use the formula above:

Mesh Information:

Geometry Size: 4/4-150/150-2750*2000

Length: 9'-1/4"

Height: 6'-6 3/4"

Example of the result of the formula, when you use set the advanced option XS_IMPERIAL to FALSE instead of TRUE:

Mesh Information:

Geometry Size: 4/4-150/150-2750*2000

Length: 2750 mm

Height: 2000 mm

For a list of valid unit and precision strings, see the valuefieldclasses.lst file located in the ..\Program Files\Tekla Structures\<version>\nt\TplEd\settings folder. Do not make changes in this file. Below is an example of the file content, which may change between Tekla Structures versions.

// ---------------------------------------------------------------------------------------
// 
// - Use only letters, numbers, slashes and underlines.
//
// ---------------------------------------------------------------------------------------
//
// Class               =        units { presicions }

Length                 =        mm, dm, cm, m, inch, ft, yd, inch-frac {1/2, 1/4, 1/8, 1/16 }, ft-frac { 1/2, 1/4, 1/8, 1/16 }
Angle                  =        Degrees, radians
Area                   =        mm2, cm2, dm2, m2, sq.inch, sq.ft, sq.yd
Area/length            =        mm2/m, cm2/m, dm2/m, m2/m, in2/in, in2/ft, ft2/ft, sq.yd/ft
Volume                 =        mm3, cm3, dm3, m3, cu.in, cu.ft, cu.yd 
Weight                 =        kg, T, N, lbf, kip
Weight/length          =        kg/m, T/m, N/m, daN/m, kN/m, lbf/ft
Density                =        kg/m3, T/m3, N/m3, kN/m3, lbf/ft3
Temperature            =        Kelvin, Celsius, Fahrenheit
Section_modulus        =        mm3, cm3, in3
Moment_of_inertia      =        mm4, cm4, in4
Warping_modulus        =        mm6, cm6, in6
Force                  =        kg, T, N, daN, kN, lbf, kip
Force/length           =        kg/m, T/m, N/m, daN/m, kN/m, lbf/in, lbf/ft, kip/in, kip/ft
Force/area             =        kg/m, kg/cm, kg/mm, T/m, T/cm, T/mm, N/m, N/cm, N/mm, daN/m, daN/cm, daN/mm, kN/m, kN/cm, kN/mm, lbf/in, lbf/ft, kip/in, kip/ft
Moment                 =        kgm, Tm, Nm, daNm, kNm, lbf-in, lbf-ft, kip-in, kip-ft
Moment/length          =        kgm/m, Tm/m, Nm/m, daNm/m, kNm/m, lbf-ft/ft, kip-ft/ft
Stress                 =        kg/m2, kg/cm2, kg/mm2, T/m2, T/cm2, T/mm2, N/m2, N/cm2, N/mm2, daN/m2, daN/cm2, daN/mm2, kN/m2, kN/cm2, kN/mm2, psi, psf, ksi, ksf
Date                   =        dd.mm.yyyy, mm.dd.yyyy, mm/dd/yyyy, yyyy/mm/dd, dd-mm-yy, dd-mm-yy, yyyy-mm-dd, dd/mm/yy
Time                   =        hh:mm:ss, hh:mm:ss:am/pm
Date&&Time             =        dd.mm.yyyy, mm.dd.yyyy, mm/dd/yyyy, yyyy/mm/dd, dd-mm-yy, dd-mm-yyyy, yyyy-mm-dd, dd/mm/yy
Date_local             =        dd.mm.yyyy, mm.dd.yyyy, mm/dd/yyyy, yyyy/mm/dd, dd-mm-yy, dd-mm-yyyy, yyyy-mm-dd, dd/mm/yy
Time_local             =        hh:mm:ss, hh:mm:ss:am/pm
Date&&Time_local       =        dd.mm.yyyy, mm.dd.yyyy, mm/dd/yyyy, yyyy/mm/dd, dd-mm-yy, dd-mm-yyyy, yyyy-mm-dd, dd/mm/yyLeadingZeroes
LeadingZeroes
DistanceList           =        mm, dm, cm, m, inch, ft, yd, inch-frac {1/2, 1/4, 1/8, 1/16 }, ft-frac { 1/2, 1/4, 1/8, 1/16 }

For more information about value fields, formats, format functions and other functions, see Template Editor User's Guide.

Was this helpful?
Previous
Next