Testing Revit files for families

Hi,

Is it possible to feed Dynamo a directory of Revit project or family files and test whether they contain a certain family? Maybe without opening the actual file?

Yes, node directory.contains works for your purpose:

Also, welcome to the forum and use the search function, it will make your life much easier by learning and asking the right questions.

Hi,

Thank you very much for your reply and the advice, appreciate it.

Sorry I don’t think my description was very clear. I don’t just want to search the directory itself, I actually want to look INSIDE each Revit file and see if those project files contains specific families that need to be replaced.

Sure thing, this node from rhythm will do:

image

Once doc is opened you have access to all elements inside.

It is possible to look for them yes, but NOT without opening the file. You would have to open the file, iterate the category your looking for, then match the name / type names.

Thank you very much for your input SeanP and architectcoding.

Given the new information I will change the process.

What I am trying to do is open a Revit file, check the loaded families to see whether they contain specific families from a directory, if the Revit file does contain those family files, I want Revit to load ONLY those files from the directory. The directory is going to eventually be filled with new Revit families and I only want Revit to load the ones that it already has, not ones that might only exist in another Revit project.

In the image I have a directory of .RFA files and a Python script that contains all of the current families loaded in to the Revit project. Before I load in the Revit files from the directory, I would like to test the Revit project file to see if it already contains the Revit family from the directory… If it DOES contain the .RFA file from the directory, I would like Dynamo to load those families in to the project. I am just struggling with the order of operation to get this process right. Do you have any ideas?

See if something like this works for you. I don’t have your exact nodes, but I think you can get the idea. Just compare the directory file names to the families, filter those, and then load as needed.

Make sure to watch your lacing since you will have list of different lengths.

1 Like

Absolutely perfect SeanP, can’t thank you enough, exactly what I needed :slight_smile:

1 Like