Another Revit filled region question

This is related to my earlier question (which I’ve still not fixed :frowning: )
Model Pattern
But it’s different enough for a new question I think…

How do I get the Filled Region Type from a newly created filled region?

FillPatternElements don’t have a type. They’re these things if not clear:
image

You can get the type from a filled region, but you’d have to feed that in rather than a pattern.

This is what I am trying to extract from my new pattern.

You’ve made a new pattern. You then need to make a new filled region and bring in that pattern.

You’ve done this bit:
image

You need to do this bit:
image

Always useful to relate the Dynamo to what you’d do manually in Revit.

Easiest way is probably to duplicate an existing pattern. Then you can use Element.SetName to rename it. And SetParameterValueByName to set “Foreground Fill Pattern” with your new FillPatternElement (along with setting color, background pattern, masking, and any other parameters are required).