Find and delete families with .dwg imports

Hi all,

I’m very new to Dynamo and am trying to clean up our family library, as it contains random internet “families” that are actually just imported dwgs with no Revit geometry.

I started a setup using the Bimorph Import Report node, but if a file contains only .dwg imports, I want it to be deleted. If it contains .dwg and Revit geometry, or just Revit geometry, it can be kept. I’m not sure how to continue after the import instance report has been generated.

I tried to follow the link below, but it seemed to be more related to CAD imports within a single project, instead of a directory of families.

Any help would be appreciated!

P.S. I’m also having an issue with the CAD Import Report Node: If I set the close parameter to true, it doesn’t report any files as containing imports. If it’s false, however, it does properly report import instances.

Any time you pull from a doc (family) that is closed down stream without converting it to some other value (string) you will not see results.

Could I set a delay on it so that it’s open long enough to be scanned, but then still closes so it doesn’t take up memory? I would like to scan a majority of our library at a time, but if I have it leave all the files open its very taxing on RAM.

What I am saying is that you need to get the information from the Family, then store something like the name of the link as a string because the actual element will not display / display null once the family is closed.

Example of digging through a family.