Merging Filled Regions

Filled Regions always get messy, duplicated, etc. I am trying to create a cleanup script, where I select the unwanted type and replace it with another one.

Already made a successful script to merge line unwanted types, it uses the name parameter to grab and replace the line types. Tried to do the same with filled regions and it turns out to be a little different Revit-wise as there is a higher level “type” of filled regions, either “detail” and “masking”.

If I try to extract family type names I get either “Detail Filled Region” or “Masking Region” as values.
So, I made it through seeing the -real- filled region names, filtered the “masked” regions, managed to isolate the duplicated type and I can see the element parameters.

Even though I can see it, I can’t get Dynamo to recognize the “Type Name” parameter name to make the switch!! In the marked code block I tried “Name”, “Type”, “Type Name”, “TypeName”, etc… I’m out of ideas what this parameter’s real name is.

If there is another way to replace an element other than Element.SetParametersByName I’m all ears.

Any ideas?

Thank you beforehand!

try the parameter Type

Thank you for your help.

The issue is that Revit somehow doesn’t recognize the parameter :frowning:

not sure why, can you show your element inputs from boolean mask?
it’s working for me

Using your method works!! Thank you.

However, I want to replace all filled region instances of a certain type at once.
Following your example I simplified it, but still no luck.

hmmn can you send your file?

It doesn’t allow me “new users can’t upload attachments”.
I guess they don’t trust me. :frowning:

Thank you so much for helping me with this.

try wetransfer and paste the link, or dropbox

Here is the link to the Onedrive folder:

https://appriver3651001614-my.sharepoint.com/:u:/g/personal/psemrau_d2-architecture_com/EZoDsfQgICdGvZZGQwlvblwBMIqcXQSK6GswYmQV46a8nw?e=CwetvB

Thanks again,

i need a revit file :slight_smile:

it is a very basic file I created for testing:

https://appriver3651001614-my.sharepoint.com/:u:/g/personal/psemrau_d2-architecture_com/EeiZy42vUoBBiuXJ5DW9j-YBYqtbLFIsD-YEgDmNYURP6Q?e=spzT9k

Try something like this

ChangeRegionType.dyn (18.2 KB)

I get this:

Even using Element.Name instead of the x.Name code block I get that same error

It WORKED on a regular file, but somehow in a template file, it doesn’t run.
The error “convert non-convertible types” in my other post was from running it in a template file, weird that it doesn’t run there.

Thank you so much for your time and patience! :smiley:

I figured out what triggers the error. If a file has a masking region drawn, then dynamo gives all kinds of errors as seen above. If there are no masking regions, then the script works.

Weird.

1 Like