Sets the Point Group query object.

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

Syntax

C#
public void SetQuery(
	PointGroupQuery query
)
Visual Basic
Public Sub SetQuery ( _
	query As PointGroupQuery _
)
Visual C++
public:
void SetQuery(
	PointGroupQuery^ query
)

Remarks

The method sets the query object in the point group, which defines the points contained within the group.

Examples

CopyC#
 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);
CopyVB.NET
 1' _civildoc is the active CivilDocument instance.
 2'
 3Dim pointGroupId As ObjectId = _civildoc.PointGroups.Add("Example Point Group")
 4Dim pointGroup As PointGroup = TryCast(pointGroupId.GetObject(OpenMode.ForWrite), PointGroup)
 5
 6Dim standardQuery As New StandardPointGroupQuery()
 7
 8' Include properties:
 9standardQuery.IncludeElevations = "100-200"
10standardQuery.IncludeFullDescriptions = "BRK*"
11standardQuery.IncludeNames = "GRND*"
12standardQuery.IncludeNumbers = "1000,1050,1075,>2000"
13standardQuery.IncludeRawDescriptions = "BRK*"
14
15' Exclude properties:
16standardQuery.ExcludeElevations = ">300"
17standardQuery.ExcludeFullDescriptions = "FLOW*"
18standardQuery.ExcludeNames = "FLOW"
19standardQuery.ExcludeNumbers = "<300"
20standardQuery.ExcludeRawDescriptions = "TREES"
21
22' Other properties:
23standardQuery.UseCaseSensitiveMatch = False
24
25' Apply query to new PointGroup:
26pointGroup.SetQuery(standardQuery)
27
28' Get pending changes:
29Dim pointGroupChange As PointGroupChangeInfo = pointGroup.GetPendingChanges()
30_editor.WriteMessage("# Points to add: {0}" & vbLf & "# Points to remove: {1}" & vbLf, pointGroupChange.PointsToAdd.Length, pointGroupChange.PointsToRemove.Length)
31
32' Apply changes
33pointGroup.Update()
34
35' Display the number of points matched:
36_editor.WriteMessage("# matched points: {0}" & vbLf, pointGroup.PointsCount)

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.
System..::..ArgumentException Thrown when the current point group is the "_AllPoints" group, since its query cannot be modified.
System..::..ArgumentNullException Thrown if the query object specified is null.

See Also