Richard, I don't know if you've seen this promising post by Duncan Hornby:http://forums.arcgis.com/threads/5690-Update-View-of-Attribute-Table-in-ArcMap-(Reload-Cache)#2Anyway, I haven't had time to check it out although I've been itching to....looks like it gets a handle on all the open tables and reloads the cache. Surprised no one has upvoted his post yet. With a knowledge of .NET add-ins, I suppose you 'hinge' a listener to execute for an on-change event -- I'm just not certain how you'd listen for changes in the map (like an Append), but guess you could also simply make an extra button, but then again you already have a 'reload cache' button in the table window.Wayne
I haven't tried it, but you could try making the table view a derived output (set the script tool parameter type and direction properties) and then using arcpy.setParameterAsText(theTableParameterIndex, theTableVariableName) at the end of your script. I believe, that I have found that this does update existing feature class tables when I add a field (in a script tool) to something that's already open.
import arcpy tblCopyRecords = arcpy.GetParameterAsText(0) if not arcpy.Exists(tblCopyRecords): arcpy.AddMessage("Invalid Input table provided: " + tblCopyRecords) xTimes = int(arcpy.GetParameterAsText(1)) tblPasteRecords = arcpy.GetParameterAsText(2) if tblPasteRecords == '': tblPasteRecords = tblCopyRecords if not arcpy.Exists(tblPasteRecords): arcpy.AddMessage("Invalid Output table provided: " + tblPasteRecords) arcpy.CopyRows_management(tblCopyRecords, "in_memory/tblScratch") for i in range(0, xTimes): arcpy.Append_management("in_memory/tblScratch", tblPasteRecords, "NO_TEST") tblOutput = arcpy.SetParameterAsText(3, tblPasteRecords) arcpy.RefreshActiveView()
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.