The string of text that is displayed is defined in the Text field. This string does not have to be a simple string such as LP. It can contain macros which allows for the extraction and formatting of point co-ordinates, attributes and dimensions. Simple mathematical expressions can also be used in these macros and the string can also be displayed on more than one line. Examples of this where you wish to display the co-ordinates of specific points, the display of both the cover and invert levels of a manhole is required or the information relating to trees, such as types, spreads, boles and heights.
A macro in a text string is signified where part or all the text starts and ends with a percentage character, %. There must be one of these at each end of each macro for it to be recognised in the form %macro%. With one exception, anything that is not inside a macro is assumed to be normal text. The exception is where you wish to display text on more than one line. A new line can be requested by using the character par \n. The simplest form of a macro extracts an attribute or a value from the current point. The value that is to be extracted is defined in the macro by a label, normally lower-case, and the following macro labels can be used.
px - This label will extract the easting co-ordinate of the point.
py - This label will extract the northing co-ordinate of the point.
pz - This label will extract the height co-ordinate of the point.
pzd - This label will extract the decimal part of the height of a point. This can be used for the display of bathometric depths where the decimal part of the text is required to be smaller than the integer part;
pc - This label will extract the code of a point. Note that any comma codes assigned to the point will not be included in the display.
pn - This label will extract the number of a point.
pp - This label will extract the point code prefix that has been used in the point code.
ps - This label will extract the string number that has been used in the point code.
pd - This label will extract a plan distance between two points. The distance displayed at a point is that between the current point and the next point in a feature.
psd - This label will extract a slope distance between two points. The distance displayed at a point is that between the current point and the next point in a feature.
pdz - This label will extract a vertical difference between two points. The difference displayed at a point is that between the current point and the next point in a feature. If the next point is higher, the value displayed will be positive.
pg - This label will extract a gradient between two points in the form of a percentage. The gradient displayed at a point is the gradient from the current point to the next point in a feature. If the next point is higher, the gradient will be positive.
pgr - This label will extract a grade between two points in the form 1:X. The grade displayed at a point is the grade from the current point to the next point in a feature. If the next point is higher, the grade will be positive.
pb - This label will extract a whole circle bearing between two points. The bearing displayed at a point is that between the current point and the next in a feature. The bearing will be formatted using the current settings for angle display.
pt - If you are using a macro to display text next to a station, this label is used to extract the type of station, such as Fixed, Known, Derived or Adjusted. It cannot be used for normal points
rem - This label is used to extract the remark from the current point.
If a label other than those described above is found or is upper case, it is assumed that it is a dimension name and the appropriate dimension value will be extracted from the point.
When displaying co-ordinate values or lengths, n4ce will format the text to use the number of decimal places used for the display of lengths. However, you can override this or define the number of decimals for the display of dimension values. This is performed by preceding the label by a decimal point followed by the number of decimals. For instance, %.3px% will extract and format the easting co-ordinate using three decimal places. If no decimal places are defined for a dimension, the dimension string is displayed as is with the exception that any superfluous zero characters are removed from the end. If you require that a co-ordinate or dimension is only displayed as an integer number, set the required number of decimal places to zero, for example %.0H%. You can also make a dimension negative by including a minus sign at the beginning, for example %-.3D%.
You can specify that a simple mathematic calculation is carried out in a macro by surrounding the expression in round brackets. The expression will have two elements separated by one of the four mathematical operators +, -, * or /. The two elements can be co-ordinate labels, dimension names or numerical values. The opening bracket can also be preceded by a specification for the number of decimal places. The text macro %.3(pz-V)% will take the value of a dimension named V away from the height of the point and display it to three decimal places. If the number of decimal places is not defined, n4ce will assume the number of decimal places used to display lengths. You can now use the "pd", "psd" and "pdz" in the simple text macro calculations. (n4ce 4.20c and above).
The examples above show how the text macros can be used to display co-ordinate information at a station, information about a manhole that has been surveyed or information about a tree that has been surveyed.
If a text macro calls for the display of a dimension, or its use in a simple calculation, and the dimension has not been assigned to the point, n4ce will look for a default value in the fields of the current code prefix. If no default value is found, then one of two things can happen depending on whether the Accept Black Fields check button is ticked. If the button is ticked, n4ce will display the line without the macro. If the button is not ticked, n4ce will not display the whole line containing the macro, regardless of other macros or text that are present on that line.
From n4ce 4.20c and above two new boxes have been introduced called Prefix and Suffix. They take effect within the Height, Number and Code sections. Text Macros have been enabled in the Prefix and Suffix sections which means that the Text Macro will be located on a different layer than ordinary Text.