Wednesday, 18 February 2015

Refreshing open attribute table in ArcMap using ArcPy rather than ArcObjects?


I am running the Calculate Field GP tool from the arcpy in ArcMap. When a row value is updated, it does not show up untill I use the Reload Cache tool (Table Options > Reload Cache). How do I refresh the attribute table automatically without using ArcObjects?


I have tried updating the definition query as @blah238 suggested Using python, how do you "reload cache" an opened Attribute Table, but this doesn't help. Resetting the data source is not an option because the feature class might be in the editing session and I don't want to lose the connection to the source data.



Answer



You appear to be hitting a limitation of ArcPy, in the absence of ArcObjects.


The limitations of ArcPy.mapping have been broadly described here as:




Arcpy.mapping is not a replacement for ArcObjects but rather an alternative for the different scenarios it supports. ArcObjects is still necessary for finer-grain development and application customization, whereas arcpy.mapping is intended for automating the contents of existing map documents and layer files.



If @blah238's other suggestion of using ArcObjects from ArcPy is not an option for you, then you may be best to submit an ArcGIS Idea to have this functionality exposed to ArcPy. If you post a link to such an ArcGIS Idea here then I will be happy to vote for it.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...