Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int position = 0;
- var combo = AddIn.FromID<btnComboBoxQ7>(ThisAddIn.IDs.btnComboBoxQ7);
- switch (combo.CurrentValue)
- {
- case ("ECOZONE"):
- position = 4;
- break;
- case ("EDIST_NAME"):
- position = 5;
- break;
- case ("ECOREGION"):
- position = 6;
- break;
- case ("ECORG_NAME"):
- position = 7;
- break;
- case ("ECODIST"):
- position = 8;
- break;
- }
- IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
- IStatusBar statusBar = ArcMap.Application.StatusBar;
- ISelectionSet2 selectionSet;
- if (mxdoc.SelectedItem is IFeatureLayer2)
- {
- string message = null;
- ILayer layer = mxdoc.SelectedLayer;
- IFeatureLayer2 featureLayer = layer as IFeatureLayer2;
- IFeatureSelection featureSelection = featureLayer as IFeatureSelection;
- selectionSet = featureSelection.SelectionSet as ISelectionSet2;
- ICursor Cursor = null;
- selectionSet.Search(null, true, out Cursor);
- IFeatureCursor featureCursor = Cursor as IFeatureCursor;
- IFeatureLayer layer1;
- layer1 = (IFeatureLayer)mxdoc.SelectedLayer;
- int fieldIndex = featureCursor.Fields.FindField("ALPS_ID");
- IFeature feature = featureCursor.NextFeature();
- while (feature != null)
- {
- message += feature.Value[fieldIndex] + ",";
- feature = featureCursor.NextFeature();
- }
- statusBar.Message[0] = "ALPS_ID is:" + message;
- ISpatialFilter spatialFilter;
- spatialFilter = new SpatialFilter();
- spatialFilter.Geometry = feature.Shape;
- spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;
- IFeatureLayer2 featureLayer2 = layer as IFeatureLayer2;
- IFeatureSelection featureSelection2 = featureLayer2 as IFeatureSelection;
- selectionSet = featureSelection.SelectionSet as ISelectionSet2;
- ICursor Cursor2 = null;
- selectionSet.Search(spatialFilter, true, out Cursor2);
- IFeatureCursor featureCursor2 = Cursor as IFeatureCursor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement