I'm looking for something similar to IActiveView.Refresh from the ArcObjects world. My use case is that I'm running a tool that updates the features in the layer, and I need a way to get the map to re-draw from my code similar to how the out-of-the-box tools are doing automatically.
In my particular example, I am using UNME and am validating the Utility Network topology, which causes the Dirty Areas polygon layer to remove polygons for areas that are valid. I tried looking around for a way to invalidate just that layer but wasn't having much luck. Any clues for how to get the layer to refresh properly? This layer is coming from a feature service published through ArcGIS Enterprise per requirements of the UNME.
Solved! Go to Solution.
Daniel,
In Pro 2.2, we'll be adding a method to the MapView class called Redraw(). This method will take a boolean parameter named clearCache. If set to true, this will reset any current features caches on layers in the view. This should solve your problem.
As a work-around at 2.1, you can call the Validate Network Topology geoprocessing tool via the Geoprocessing API, as shown here. This will correctly redraw the map.
--Rich
Daniel,
In Pro 2.2, we'll be adding a method to the MapView class called Redraw(). This method will take a boolean parameter named clearCache. If set to true, this will reset any current features caches on layers in the view. This should solve your problem.
As a work-around at 2.1, you can call the Validate Network Topology geoprocessing tool via the Geoprocessing API, as shown here. This will correctly redraw the map.
--Rich
Did this Redraw Class ever get created? I need to redraw my feature class as I have multiple users working in the same geographic area and being able to trigger this would be great.
It's planned for 2.2, shipping summer 2018.
What is a workaround to refresh the feature cache for a particular layer? Is there something I am not finding here?
Unfortunately, there's no workaround at this time.
Just to confirm, this method will be available in Pro 2.2.
Its there now!
I'm interesting in using this new method, but can't find any documentation or examples. My attempts to make a call to it fail, but wanted to follow-up to see if anyone had anything to share.
Thanks!
Charles,
The API reference is here: http://prodev.arcgis.com/en/pro-app/sdk/api-reference/#topic20822.html
Can you share more about what isn't working?
Thanks,
--Rich