Get All PMI objects in workPart

Our modeling standard is to have several model views with logical subsets of the PMI. We also include one model view named "ALL" that should have every PMI object.

I am trying to write code to make sure every object is displayed in the ALL view.

the only option I have found so far is to get separate arrays of each specific type of annotation object:


foreach (NXOpen.Annotations.Annotation a in workPart.Annotations.Fcfs)
{//...}
foreach (NXOpen.Annotations.Annotation a in workPart.Annotations.CustomSymbols)
{//...}

etc.

is there any way to get all objects of type NXOpen.Annotations.Annotation ?

I think i found the solution:

foreach(NXOpen.Annotations.Pmi p in workPart.PmiManager.Pmis.ToArray())
{
NXOpen.Annotations.Annotation a = p.GetDisplayInstances()[0];
}