The FeatureLayer.SelectSpecial method returns an AutoCAD selection set from a specified feature layer based on special criteria. This method is useful for quality assurance and compliance checking before synchronizing web feature layers or to find entities based on various editing and data states when working with feature layers.
The special search criteria include the following:
- FlaggedAsModified—AutoCAD entities that qualify as features of the specified web feature layer and that have their editing state flagged as modified.
- FlaggedAsNew—AutoCAD entities that qualify as features of the specified web feature layer and that have their editing state flagged as a new feature.
- IncorrectGeometry—AutoCAD entities that would qualify as features because of the AutoCAD layer they reside on but that are not considered features because they are of the wrong geometric type. An example is polylines that are drawn on an AutoCAD layer of ArcGIS for AutoCAD point features.
- OutsideProjectArea—AutoCAD entities that qualify as features of the specified feature layer and that are outside the current project area boundary.
- ProxyObjectPresent—AutoCAD proxy entities that are used to represent custom object geometry, such as COGO points outside Autodesk Civil 3D, or when no object enabler is present.
- UnclosedPolyline—AutoCAD polyline entities that would qualify as polygon features but the polyline closed flag is not set on the entity.
Note:
Attempting to manage a large number of selection sets simultaneously is not recommended. An application cannot have more than 128 selection sets open at once. (The limit may be lower on your system.) When the limit is reached, AutoCAD will not create more selection sets. Keep a minimum number of sets open at a time, and release them from memory as soon as possible. If the maximum number of selection sets is reached you will not be able to create more.
Declaration
public SelectionSet Esri.ArcGISForAutoCAD.FeatureLayer.SelectSpecial(Document doc, string flName, string criteria, string sublayerName = null)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | flName | An existing feature layer name in the drawing. | required |
string | criteria | The special criteria. The options are as follows:
| required |
| string | sublayerName | An existing feature layer sublayer name as a string. | optional |
Returns
| Type | Description |
|---|---|
SelectionSet | An AutoCAD selection set of features that meet the special criteria. |
Remarks on error conditions
This method may throw an exception or return null if a parameter is invalid.
Example 1
Print the number of entities that belong to the Shelters feature layer that are outside the project area of the current drawing.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Create a selection set with the criteria
var sheltersSelection = Esri.ArcGISForAutoCAD.FeatureLayer.SelectSpecial(doc, "Shelters", "OutsideProjectArea");
// Print the selection count
doc.Editor.WriteMessage("\nNumber of entities selected: " + sheltersSelection.Count.ToString());
/* Example output
Number of entities selected: 30
*/
Example 2
Print the number of entities in the current drawing that belong to the Public sublayer of the Roads web feature layer that are considered by ArcGIS for AutoCAD to have been modified before synchronizing.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Create a selection set with the criteria
var publicRoadsSelection = Esri.ArcGISForAutoCAD.FeatureLayer.SelectSpecial(doc, "Roads", "FlaggedAsModified", "Public");
// Print the selection count
doc.Editor.WriteMessage("\nNumber of entities selected: " + publicRoadsSelection.Count.ToString());
/* Example output
Number of entities selected: 5
*/
See also
FeatueLayer.Select—A .NET method that returns an AutoCAD selection set filtered by the specified feature layer and optional sublayer from the drawing, and optionally, a specified selection set and attribute query.
esri_featurelayer_selectspecial—An AutoLISP function that returns an AutoCAD selection set from a specified feature layer based on special criteria.