You are currently reviewing an older revision of this page.
You have a series of Points and want to select a sub-set of Points from the same.
Let us discuss about the basics of Query Expression:Query Expression works on linear lists. Query expressions have 2 required parts1. Definition of variable 2. Identification of the source list from which the variable is selected.
In a Query Expression, 'from' is the keyword that starts the Query Expression, then we need to put the variable (here we have used 'point' as the variable). After that we need to use the 'in' keyword which will specify the source list, then we will be using the source list (here Point1 is the source list)
In this method, we will be selecting a set of Points from a series of Points.
If we need to select first few points in a point series, we can do it by the expression below:from point in Point1
This means, the selected points will be all the points in the point list.
To identify the sub-set of points, we will create vertical lines on those selected Points. Here Point1 is the set of points & it begins from left to right. (The same will be followed in the below mentioned methods also)
If we need to select first few points in a point series, we can do it by the expression below: from point in Point1 take 5 That means it will take the first 5 points (Point1[0] to point1[4]). You can select any number of points in the point list. Here we are selecting 5 points.
If we need to select few points in a point series, we can do it by the expression below:from point in Point1 skip 5 This means it will skip the first 5 points and take the rest of the points in the list.
If we need to select in between points in a point series, we can do it by the expression below: from point in Point1 take 8 skip 5 That means it will take the points from 5 to 7 (Point1[5] to point1[7]). In this expression the starting of the selection of the point will be of point number 7, as 8 is an argument to the list method and as we have commanded to skip 5 points so point 5, point 6 and point 7 will be selected.
Please go through the sample file, 4111.Selection of points based on Query Expressions.gct