A very time consuming issue that I commonly encounter is when a keynote appears in keynote legend but is not visible in any of the views on the sheet. As a dumbed down explanation, because the annotation exists within any view(s) on the sheet, the keynote value appears in the keynote legend whether it is visible or not. Keynotes can become invisible if the item they are hosted to is no longer visible, the annotation is no longer within crop boundary of the view, or simply the annotation is hidden. What usually gets overlooked is that this extends to phasing of elements, closed worksets, or even the view range of the view.
Finding a missing keynote involves toggling through just about every visibility setting. If there are multiple views on a sheet, you need to find out which view or views the keynote is in and remove it from the views to remove it from the legend. I wanted to create a better way of handling this using dynamo.
In the Dynamo workspace shown below, I’ve setup a workspace where we can select all elements in the view and filter the list to get annotation items, and compare that list to the list of annotations in the model that should be in the view. This produces a list of non-visible annotations in the current view so we can delete them.
Next we need to compare the list of annotations that are not visible in the current view with the workset value of the current view. What we’re doing here is finding the non-visible annotation in the view. (See the post of Revision Clouds for more information on the code block and why the workset of the annotation in a view is one greater than the workset of the view.)