How to know if subcategory is being used in the project Revit file or inside a family file in project with Dynamo?

How to know if subcategory is being used in the project Revit file or inside a family loaded or a cad import loaded in project with Dynamo?
is there a quick Revit API method to know this? I do not want to get absolutely all elements of a Revit project file to query the category of the elements or the category Id