Collect only used annotation objects in a family

Is there a way to get only used annotation object categories from a family? I want to purge unused line patterns from families. I was going to compare the list of line patterns in a family to the one’s used by the model objects and annotation objects in object styles. I can do this with model objects with the following:

However I don’t know how to do this with annotation. I’ve created this for another script that exported all annotation object styles to excel but it collects all the annotation categories.

Compare the above with what is actually in the family:

Is there a way to only get what is used in the family? Are there standard annotation categories that are in all families so I can just select the the categories by name or do they vary per category?