I'm working on a script to sort elements in the objects docker (and on the page as well of course) I've tried both Optimization and EventsEnabled and both work on the page BUT the property docker does not update unless I click on another drawing tab and then back again - or save the drawing and reload.
This is using CD ver 2019
Here's the code:(and this is pretty basic - I need to make a proper bubble sort)
Sub ShapeSort()Dim i As Integer, j As Integer, k As Integer, m As Integer, One As Shape, Two As ShapeDim sr As ShapeRangeSet sr = ActiveLayer.FindShapes 'all typesm = 10 * sr.CountOptimization = TrueFor k = 1 To mFor i = 1 To sr.CountFor j = i + 1 To sr.CountSet One = sr(i)Set Two = sr(j)If One.Type > Two.Type ThenTwo.OrderForwardOneEnd IfNext jNext iNext kOptimization = FalseActiveWindow.RefreshApplication.RefreshEnd Sub
I am seeing this behavior in 2019 with my VBA macros, too.
The macros do their job, but the changes aren't immediately shown in the Objects docker. This is not good!
If I close / open the Objects docker, then it updates to show the changes.