SelectByIDFile()
Summary
Selects map features from a list of feature IDs stored in a file.
Changes
Optional options array introduced in Version 5.0.
Syntax
n_selected = SelectByIDFile (string set_name, string operation, string id_file [, array options])
| Argument | Contents |
|---|---|
| set_name | The name of the selection set |
| operation | The operation to perform, as indicated below |
| id_file | A text file containing a list of IDs |
| Operation | Meaning |
|---|---|
| several | Replaces the contents of the selection set |
| less | Removes features from the selection set |
| more | Adds features to the selection set |
| subset | Selects a subset of the selection set |
| Option | Type | Contents |
|---|---|---|
| Inclusion | String | "Enclosed" or "Intersecting", overriding the current setting; for more information, see SetSelectInclusion() |
| Max | Integer | Maximum number of records to select |
| Display | Boolean | "True" or "False" overriding the current setting; for more information, see SetSelectDisplay() |
| Auto Redraw | Boolean | "True" or "False" overriding the current setting; for more information, see SetSelectAutoRedraw() |
| Source And | String | A selection set on the current layer that records must be in to be selected |
| Source Not | String | A selection set on the current layer that records must not be in to be selected |
Returns
An integer indicating the number of records in the selection set.
Notes
-
The options array is an optional argument.
-
All selection commands operate on the current layer.
-
If the set does not already exist, SelectByIDFile() creates it.
-
If there is an ID in the file for which there is no corresponding record, the ID is ignored.
-
The file must consist of one ID per line.
Error Codes
| Error Type | Meaning |
|---|---|
| Error | The set name or the operation type is invalid |
| NotFound | The ID file does not exist or no features match the IDs in the file |
See Also
| Function | Summary |
|---|---|
| SelectByQueryFile() | Selects records based on an SQL query that is stored in a file |
| SelectByIDs() | Selects map features from a list of feature IDs |