Copy filled regions as masking -> script does not updating patterns

Hello guys!
I’ve created script which is creating new filled regions as solid fill types in a given color range.
But it went out that I need some of them to be copied as masking regions.
Now my script is half working.
It copies filled region types as masking ones, but it is not updating their pattern/color.
When I look at hierarchy of script elements it seems ok for me.
Does anyone know how to fix it?
I will add that after removing the masking types from the document dynamo gonna create filled regions with proper graphic style…
New_Solid_fill_Collor_Range.dyn (133.9 KB)

Use a solid white as a work-around. They’re more capable anyway.

Thanks guys for quick replies.
@SeanP I have checked it out and boolean is working in that case, so is there any point of changing it?
@jacob.small can I ask you where should I use white solids as work around? At which stage of script? Do you mean at the beginning or where?

The last time I checked Masking Regions (the type you use to obscure parts of a model in the Revit user interface) are not accessible via the API.

Setting a fill pattern color would be done as shown here: Setting Filled Region Type Color? - #2 by Alban_de_Chasteigner.

1 Like

No, I misunderstood what the problem you were having was. If the Boolean is working there is no reason to change it.

Ok, I see that we do not understand eachother. @jacob.small before creating my script I have read that post which you attached. Mine settings are made same as in that post. The problem is that “red” part of my script is coping created fill regions as masking ones but do not copy their “style/type”. It works for the 1st time, only if in Revit document there are no filled regions with same name as masking ones.
So it looks like that:
-script generates filled regions with fill style as solid fill at range of colors and names them [Height_5m, Height_8m…ect.],
-next it copies selected regions as masking ones [Height_5m_masking… ect.],
-if Revit document is “clear” script works fine for the 1st time,
-if Revit document contains filled regions created by script it only updates style of non masking regions.

I think it is due to fact that script is not overriding styles of masking regions. But it seems dumb for me because if we look at script order it overrides style of non masking one (that part of script works every time) and then it copies selected type as masking one. And there the problem begins, cause it is not coping overriden styles of non masking filled regions. It lefts masking regions with the same style as it was for the 1st run of script. :frowning:
Sorry for my english. I hope it is more clear now.

Is the only solution to again override style of masking ones same as non masking? It will make script much bigger and I thought it is not necessary.

From your last message it sounds like this is related to the baking/element binding from dynamo into revit, this is a system where dynamo will remember what you have changed(within dyn file) and let you amend/update these elements when you re-run the script.

There are examples on this forum of this and possibly how to sort, but i cannot find a correct version for you at this time. @jacob.small might know of a good example that could help.

@Jacko can you please do a screencast showing the behavior? I am still not sure I understand the issue. :slight_smile: