Select - Geometry: Expression

The Expression template appears in the template list when a geometry field, of type geom, geommfd, or geomwkb, has been picked in the Select pane.   The template selects records using SQL expressions.

 

Expression

Select using the given expression.

 

Launch the template by choosing a geometry field in the Select pane and then double-clicking the Expression template.  When the template launches we can specify options.

 

Example: Select Objects with Z Values

We open a sample drawing, which has three areas, two lines and two points.   Some of the objects have Z values and some do not.  We will use the Expression template to select those objects which have a Z value.

 

 

Opening the drawing's table, there is no attribute field giving a Z value, since Z values are embedded in the geometry of the objects, along with the X and Y values that define coordinates.

 

With the focus on either the drawing window or the table window, in the Select pane we choose the Geom field.   We double-click on the Expression template to launch the template.

 

 

In the Expression template, we press the Edit Expression button.   In the Expression dialog that opens we enter the expression

 

GeomHasZ([Geom])

 

and then we press OK.  

 

Back in the Select pane, for the Action, we use the default replace selection option.

 

Our example expression uses the GeomHasZ function.  The function returns TRUE if an object has a Z value.

 

Press Select.

 

 

Objects that have Z values in their geometries are selected in the drawing.  

 

 

Corresponding records are also selected in the table.   If we would like to select records without a Z value, we simply enter Ctrl-I to invert the selection, or we choose Edit - Select Inverse.

Example: Select Objects with Normalized Geometry

The system keeps track of geoms that have been normalized.  Normalized geometry values store an explicit normalized flag plus additional normalize data which allows quickly transforming geometry either to normalized form required by OGC or to the different normalized form required by ESRI.   We can use the GeomIsNormalized function in an expression to select objects that have been normalized.

 

We open a sample drawing, which has three areas, two lines and two points.   Some of the objects may be normalized and some may not have been normalized.   We will use the Expression template to select those objects which have been normalized.  

 

 

Opening the drawing's table, there is no attribute field indicating which objects have been normalized, since that is normally an internal matter within the geometry of objects not of interest to most end users.

 

With the focus on either the drawing window or the table window, in the Select pane we choose the Geom field.   We double-click on the Expression template to launch the template.

 

 

In the Expression template, we press the Edit Expression button.   In the Expression dialog that opens we enter the expression

 

GeomIsNormalized([Geom])

 

and then we press OK.  

 

Back in the Select pane, for the Action, we use the default replace selection option.

 

Our example expression uses the GeomIsNormalized function.  The function returns TRUE if an object has been normalized.

 

Press Select.

 

 

Objects that have had their geometries normalized are selected in the drawing.  

 

 

Corresponding records are also selected in the table.   If we would like to select records that have not been normalized, we simply enter Ctrl-I to invert the selection, or we choose Edit - Select Inverse.

 

 

See Also

Select - Geometry

 

Select - Geometry: Null

 

Select - Geometry: Search

 

Select - Geometry: Spatial

 

Select Reference

 

Select - Expression