To create a calculated text property (TB_SQL)
The following example can be reproduced with the demo data set. You use the TB_SQL text function to define a thematic rule for the stylization of the Landuse feature class. Using the calculated property, you can define the area stylization without using an Oracle view.
- In the Maintenance workspace, open an enterprise industry model project.
- Select a display model and click Generate Graphic.
- In the Display Manager, right-click a feature class, such as LANDUSE_TSUR.
- Click Create A Calculation.
- In the Create A Calculation dialog box, enter a name, such as LU_Type.
- Click Text Function and click TB_SQL.
- Insert the SQL command in parentheses after the function. Make sure you use apostrophes for a text string.
’SELECT TO_CHAR(MAX(C.ID_TYPE)) FROM LANDUSE_TCEN m,LM_LANDUSE c
WHERE C.FID=M.FID_CENTROID AND M.FID_TSUR=g.FID’
The calculated property provides the land-use type that is stored in the centroid feature class LM_LANDUSE.
- Click OK to create the calculated property.
- In Display Manager, right-click the feature class and click Zoom To Extents.
- Right-click the feature class and click Edit Style.
- In the Style Editor, add a Thematic Rule.
- In the Create/Modify Expression dialog box, click Properties. Under Text Properties, select the calculated property, such as LU_Type.
- Define the rule, such as LU_TYPE = ’27’.
This rule styles the land use polygons that have the land use type LM_LANDUSE.ID_TYPE = 27 = Building Area.
- Style the layer.
To create a calculated text property (TB_VARIABLE)
In the following example, you use the TB_VARIABLE text function to define a thematic rule for the a building style.
- In the Maintenance workspace, open an enterprise industry model project.
- Select a display model and click Generate Graphic.
- In the Display Manager, right-click the feature class, such as LM_BUILDING, and click Create A Calculation.
- In the Create A Calculation dialog box, enter a name, such as VARIABLE_BUILDING.
- Click Text Function, and click TB_VARIABLE.
- Insert the Key in parentheses after the function.
Make sure you use apostrophes for a text string. (’BUILDING’)
- Click OK to create the calculated property.
- In the Display Manager, right-click the feature class and click Zoom To Extents.
The key values for the calculated properties, as well as the user ID, must be specified in TB_VARIABLE.
- To work with a TB_VARIABLE that contains 1 or more values, enter an expression, such as the following:
Instr (
Concat(
Concat( ',' ,
TB_VARIABLE ('Highlight_List_Building' ) ),
',' ),
Concat( Concat( ',', ToString( FID) ), ',' )
)
To add the key values in TB_VARIABLE
- In the industry model explorer, under System Tables, right-click TB_VARIABLE and click Show Form.
- On the form toolbar, click New Record.
- Enter the key values:
USER_ID Specifies the user. Enter the TB_USER.ID. In AutoCAD Map 3D, the variable will only apply if this user is connected to the database. For other users, the variable will not take any effect.
KEY Specifies the key that is used in the calculated property, such as BUILDING.
VALUE Specifies a value for the key. For example enter the FID of the specific building you want to represent using a special style.
To style a feature layer using a calculated property
- In the Display Manager, right-click the feature class and click Edit Style.
- In the Style Editor, add a Thematic Rule.
- In the Create/Modify Expression dialog box, click Properties.
- Under Text Properties, select the calculated property, such as VARIABLE_BUILDING.
- Insert an expression, such as VARIABLE_BUILDING = TOSTRING(FID).
- Click OK.