Gets or sets the query string.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 10.3.488.0

Syntax

C#
public string QueryString { get; set; }
Visual Basic
Public Property QueryString As String
	Get
	Set
Visual C++
public:
property String^ QueryString {
	String^ get ();
	void set (String^ value);
}

Return Value

A string that selects points for a point group.

Remarks

Queries are made up of one or more expressions. An expression has three components:

  1. a property
  2. a comparison operator (> < >= <= =)
  3. a value

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:

  1. expressions in parentheses, with innermost expressions evaluated first
  2. NOT
  3. Comparisons
  4. AND
  5. OR

See the Civil 3D Developer's Guide for more information about writing query strings.

Examples

CopyC#
 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);
CopyVB.NET
 1' _civildoc is the active CivilDocument instance.
 2'
 3Dim pointGroupId As ObjectId = _civildoc.PointGroups.Add("Example Point Group2")
 4Dim pointGroup As PointGroup = TryCast(pointGroupId.GetObject(OpenMode.ForWrite), PointGroup)
 5
 6Dim customQuery As 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}" & vbLf, pointGroup.PointsCount)

See Also