Custom |
Queries are made up of one or more expressions. An expression has three components:
Queries can also contain set operators: AND, OR, and NOT.
Multiple expressions can be combined using set operators, and expression precedence can be set with parentheses.
Ranges are defined using AND, rather than the hyphen used by StandardPointGroupQuery. For example: "PointNumber>=100 AND PointNumber<=200" for the range of points between 100-200.
The order of precedence in query evaluation is:
See the Civil 3D Developer's Guide for more information about writing query strings.
1// _civildoc is the active CivilDocument instance. 2// 3ObjectId pointGroupId = _civildoc.PointGroups.Add("Example Point Group2"); 4PointGroup pointGroup = pointGroupId.GetObject(OpenMode.ForWrite) as PointGroup; 5 6CustomPointGroupQuery customQuery = new CustomPointGroupQuery(); 7customQuery.QueryString = "(RawDescription='GR*') AND (PointElevation>=100 AND PointElevation<=300)"; 8pointGroup.SetQuery(customQuery); 9pointGroup.Update(); 10 11// Display the number of points matched: 12_editor.WriteMessage("# matched points: {0}\n", 13 pointGroup.PointsCount);