Selecting/Filtering elements by subcategory in project environment

Hello community,

We are trying to purge subcategories in our project file, starting with detail items, but in order to do so we need to know on what families these subcategories exist.

is this possible?

1 Like

I have found this app in the Kiwi Bonus Tool Package that does what I need.


it gives me a true/false if the subcategory exists.

How can we do this in dynamo???

I am digging a bit on what the app does and I think what it does is open every family, read and close.

This way can collect the data,I guess we can do the same here.


You can retrieve the subcategories and their properties like this :


Amazing Alban!!!

You are Genious!!!

Thank you very much


I have another question,

I would like to compare Project subcategories with family subcategories and delete from the project the one that should not exist.

I have created this graph but I dont know how to retrieve the id of the subcategories so I can delete them.

Any ideas?

I am using the python script from this post but I don’t think is correct.

Dyn attached.

Home.dyn (13.9 KB)

Hi Francisco,

Use the ꟿ Document.DeleteElements node to delete the subcategories.


Great Alban!

Which package includes the last node,ꟿ Document.DeleteElements?

The Springs package

Great,I guess I don’t have the latest one

Many thanks

This works perfectly,

Thank you very much Alban!

Here is the graph in case anyone fancy.

Purge category subcategories.dyn (15.4 KB)

1 Like

Dynamo couldn’t find Node ‘Family.ByCategory’

Is it from a package?

Family Get Subcategory from Genius loci doesn’t work either.

UPDATE: on testing Family Get Subcategory works for Detail Items, but no other categories.

Hi Antony,

With Dynamo 2.03, the Family Get SubCategory node works normally.

I tested it in a smaller, simpler, artifically created project and it worked.

So it seems there is something it comes across in a more complex project (a.k.a. a real project) that causes the node to fail.

A clue could be it caused Revit to demand some entities be deleted within families when it ran. No doubt those familes were dodgy but why would that happen if all the node was doing is collecting subcategory names? The families don’t need to be changed in any way.

Ah, Dynamo and the Revit API, works one minute then doesn’t.

You would think AutoDesk with its billions of profit could put a bit more into providing a reliable coding platform. Oh how I miss the days of lisp.

Antony McPhee

Thanks for the explanation.
I sent you in a private message a modified version of the custom node that should work better and will update the package.