Delete Unused Filled Regions - List Filtering Help

Hi, I am brand new to Dynamo for Revit but I think it will be the best tool for what I need. I am working on an inherited model that has 228 filled region types in the model only 94 are used currently - I hope to trim that down later. First, it would be great to delete all unused types. I can only get lists to show all 228 in project, however. Any tips are welcome

Why not use the purge unused command? Fairly certain it will remove the unused filled region types…

1 Like

Hello @matttdue and welcome to the dynamo forum.
Getting the unique typ names is a good start.
But how to check if a type is used? You can’t know that if you look at a type.
You have to check if elements exist that use this types.

So you should get all filled region elements in the project and see what types they use. Then compare these with your unique types.

To get elements check out “all elements of category” and “all elements of type”. Important nodes in combination with the “categories” and “types” nodes.

Please make sure to open up all node results when posting dynamo screenshots, so we can see whats going on. Also we are inrerrested in the error messages you get. Just for future posts, :wink:

Thanks for your reply! However, OOTB Revit Purge Unused does not include user created Filled Region Types - the list you choose from when you go to create an Annotation>Filled Region

It does purge Filled Regions, when you go to purge unused button. Expand “Detail Items” then you will see filled Region.

Also what version of revit are you using?

Only in revit 2024 there is now a new API - The Building Coder: What's New in the Revit 2024 API

Thanks for your reply @gerhard.p !

And thank you for the tips. I must apologize and stress that I am really really new to dynamo and will need a lot of help to understand.

My file is a collection of things I saw in other posts about purging unused elements, but it does not seem to translate well to filled regions OR more likely I just don’t know what I’m doing and messing it up. Anyhow, I am most unclear on how to go about getting the unused types in a list. List Unique gets me all 228 just fine. but attempting to clean and flatten the list does not change it (still 228 in List.Flatten preview).
If that did actually work, my understanding is to use filter by bool mask with my complete + used elements list?

Also, perhaps I misunderstood your comment about categories, but trying that on the Filled Region Category provides and Empty List.

Screenshot of all the list related stuff I have been trying, and .DYN file attached if it helps.

I appreciate all feedback & help!


FILLED REGION PURGE TEST.dyn (72.2 KB)

Seems to work for me. Got an example file where it doesn’t work?

Or do you want to purge t h e Fill Patterns?

This is a 2023 cloud model.

Ok this is awkward and embarrassing. It most certainly is there. I apologize to @jacob.small

I don’t know how I missed it and then sunk hours into struggling with a new software, but here we are…

image
image

Maybe we can still turn this disaster of a post into me learning a little dynamo still? Because it might be worth it to change the file from purging to substituting. Is that simple and possible in dynamo? To select all elements using a particular style and choose what to change them to? Or easier to just do it manually some way in Revit at that point?

No worries! We’ve all been there before.

I’d phrase this as “spending a few hours getting to learn a new tool”. :smiley:

Plus you wouldn’t have this in your back pocket for later:

2 Likes

Get unused filled region types:

Set a filled region type to a filled region element:

3 Likes