Examples

AutoCAD Map 3D Geospatial Platform API

 
Examples
 
 
 

These examples assume that the feature class you are querying has an integer property named year and a string property named owner. To select all features newer than 2001, create a filter like this:

MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
queryOptions.SetFilter("year > 2001");

To select all features built between 2001 and 2004, create a filter like this:

queryOptions.SetFilter("year >= 2001 and year <= 2004");

To select all features owned by Davis or Davies, create a filter like this:

queryOptions.SetFilter("owner LIKE 'Davi%s'");