This tutorial will explore replacing text in cells using Property Based Annotation (PBA).
Some applications require cell features to be placed with the text in the cell replaced by a property or some other value. For example, a cell indicating a hydrant cell might contain a text placeholder for an asset tag value, or a title block cell might have text placeholders for a title or drawing number.
In this example, a simple title bock cell contains three text replacements: Property_01, Property_02 and Property_03, where Property_02 is incremented by a value of 1 for each cell placement.
The following describes how this cell is defined in the GSA.
Property_01 is defined as a normal text box.
Property_02 needs to increment by a value of 1 with each placement. To do that the Initial Value is set to increment the firstNumeric to a value of 1
Property_03 is a normal text box.
In the Symbology node, Replacement Text is defined for each text item in the cell that needs replacing. Since the value of the replacement text will be the property values, they are defined as follows:
The Replacement Text Details are defined as follows. Note the Old Text is the text found in the cell.
(This example is extracted from the delivered example schema.)
In the following example, the property values determine which cells to use as well as the values for the replacement text. For example, cell PBA_01 is used when Alex is selected as prop4. Text is incremented by a value of 1, 2 or 3
When Geddy is selected as prop 4, the cell is changed to PBA_02 and the text is incremented by a values of 1, 2 and 3 respectfully.
When Neil is selected as prop 4, the PBA_01 cell is used and the text is replaced as defined in the GSA.
The following describes the feature definition in the GSA.
The cells each contain four text replacement text elements placed as [x]:
In the Geospatial Administrator, the cell feature has four properties where prop4 has a domain list containing the following values: Alex, Geddy, Neil
Properties prop1, prop2 and prop3 are incremented by a value of 1, 2 and 3 respectively. This is defined in the Initial Values section for each property:
Named Criteria for each value in the domain list for prop4 is created:
As noted above, cell PBA_01 is used when prop4 is set to Alex. If prop4 is not Alex, then use cell PBA_02. This is defined in the Cell Name key in the Symbology node.
In the Symbology dialog, a PBA Replacement Text key is added for each instance of text found in the cell. This is done by selecting the cell name key, performing a right click and selecting the PBA Replacement Text.
For each replacement text that will be populated with a property value, enter the [property name] in the Value column.
The Replacement Text Details for each are described as follows. The Old Text value is the text found in the cell. The Type specifies the action to take. For text that will be replaced with a property value, the Type is set to Expression.
In the Symbology dialog, a PBA Replacement Text key is added for each instance of text found in the cell to be replaced. This is done by selecting the cell name key, performing a right click and selecting the PBA Replacement Text.
The Replacement Text value is given a unique name. In this example it’s text3 to correspond to the  text in the cell.
The Replacement Text Details are described as follows. The Old Text is the text found in the cell. The Type specifies the action to take. For text that will be replaced with alternate text, set the Type to PBA.
In this example, the Replacement Text defined as text3 will be replaced with PBA text. To define the PBA key, a PBA Expression is inserted via the right click menu. Next the value for the PBA key is defined. Select each Replacement Text item, right click and choose to insert PBA Expression:
The Name is set to the Replacement Text value, and the Type to PBA Expression.
The value for the PBA key is defined as follows. Note that a criterion has been added to drive this text replacement.
How it comes together:
The attached zip file includes the project schema and cells used for this tutorial.