I'm new to GIS.

I have taken over a project that is an AddIn for an ArcGIS Desktop app. C# VS 2010 project. I can get the Selected Features just fine when they are selected but when I add or remove selected rows the blue highlight disappears! I know there are selected rows there as I can see the (4 out of 2000 Selected) etc at the bottom of the window. If I click show all highlighted then I see just those row which are then highlighted, and then when I click Show all Rows the highlighted row a there in blue again along with all rows, which is great.

BUT, how can I code the AddIn so that the highlights remain? Is there a Reselect Selected Features in Attribute table window method somewhere?

I declared this in my class but don't know how to use it!

public esriTableSelectionActions TableSelectionAction { get; set; }
  • you should share parts of your code here to better get help from others. How do you try to select (and highlight) new features with arcobject. And remember that there is difference between selection (blue) and highlight (yellow) in arcgis application. – Farid Cheraghi Oct 9 '15 at 19:37
  • Are you speaking about the attribute table where the 'selected' features go missing? I have seen several times the new features I add are not shown in the attribute table or selected. Sometimes simply closing and reopening the attribute table will have the feature showup again. – Petunia311 Oct 9 '15 at 19:44
  • I have no code to share because I don't know how to get a hook on the Attribute table from the AddIn Code. The line in my initial question was something I found on the GIS ESRI site. – Dave Stuart Oct 9 '15 at 22:56
  • So this is what I do. 1. Open Attributes Table and select the rows I want to work with in my AddIn. Looks Like this onedrive.live.com/… 1a StartEdit 2. Then I do Ctrl+Click a 3rd one and I get this onedrive.live.com/… Note that the hightlighted rows are no loger highlighted BUT see that there are 3 selected in in count at the bottom of the window. How to I make sure that all stay Highlighted? – Dave Stuart Oct 14 '15 at 16:25
  • @FaridCher Can you elaborate on the difference between selection and highlight. Cannot seem to find relevant interfaces for highlight in ArcObjects API – mstaessen Apr 26 '16 at 9:58

You could try using Describe(layername).

I have a program i'm building that helps to check the selected features.

desc = arcpy.Describe(lyrResult)

      if desc.fidSet != '':
| improve this answer | |
  • Hi, I don't know what you mean sorry. My solution was to force the stop editing after the update was saved and then everything is de-selected. The user then has to re-select what they want to edit and then start Editing. – Dave Stuart Nov 12 '15 at 20:42
  • @DaveStuart Hey Dave, I'm not sure did I understand your question right there, were you asking how to select features based on the currently selected features? use arcpy.describe can help you check if the feature is selected, and make conditions to generates outputs accordingly. I have a code i wrote before, it's too long to put in here but if you are interested, you can check it out from my github, github.com/Maxguojiaqi/LandInformationSimplification/blob/…, between line 355~370. – MaxG Nov 12 '15 at 21:02
  • what it does is it will help check if two layers have overlay features, if it does output the feature; if doesn't , skip. – MaxG Nov 12 '15 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.