PointGroupSetQuery Method

Sets the Point Group query object.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.8.0.292
Syntax
public void SetQuery(
	PointGroupQuery query
)

Parameters

query  PointGroupQuery
 
Exceptions
ExceptionCondition
[!:Autodesk::Civil::DatabaseServices::PointGroupQueryInvalidPointGroupValueException] Thrown when the query object uses a point group that does not exist or refers to the same point group where the query is being set.
[!:Autodesk::Civil::DatabaseServices::PointGroupParserError] Thrown when the query does not match the supported syntax of the query object.
ArgumentException Thrown when the current point group is the "_AllPoints" group, since its query cannot be modified.
ArgumentNullException Thrown if the query object specified is null.
Remarks
The method sets the query object in the point group, which defines the points contained within the group.
Example
 1 // _civildoc is the active CivilDocument instance.
 2 // 
 3 ObjectId pointGroupId = _civildoc.PointGroups.Add("Example Point Group");
 4 PointGroup pointGroup = pointGroupId.GetObject(OpenMode.ForWrite) as PointGroup;
 5
 6 StandardPointGroupQuery standardQuery = new StandardPointGroupQuery();
 7
 8 // Include properties:
 9 standardQuery.IncludeElevations = "100-200";
10 standardQuery.IncludeFullDescriptions = "BRK*";
11 standardQuery.IncludeNames = "GRND*";
12 standardQuery.IncludeNumbers = "1000,1050,1075,>2000";
13 standardQuery.IncludeRawDescriptions = "BRK*";
14
15 // Exclude properties:
16 standardQuery.ExcludeElevations = ">300";
17 standardQuery.ExcludeFullDescriptions = "FLOW*";
18 standardQuery.ExcludeNames = "FLOW";
19 standardQuery.ExcludeNumbers = "<300";
20 standardQuery.ExcludeRawDescriptions = "TREES";
21
22 // Other properties:
23 standardQuery.UseCaseSensitiveMatch = false;
24
25// Apply query to new PointGroup:
26 pointGroup.SetQuery(standardQuery);
27
28 // Get pending changes:
29 PointGroupChangeInfo pointGroupChange = pointGroup.GetPendingChanges();
30 _editor.WriteMessage("# Points to add: {0}\n# Points to remove: {1}\n",
31     pointGroupChange.PointsToAdd.Length, pointGroupChange.PointsToRemove.Length);
32
33 // Apply changes
34 pointGroup.Update();
35
36 // Display the number of points matched:
37 _editor.WriteMessage("# matched points: {0}\n", 
38   pointGroup.PointsCount);
See Also