Subelements of Filled Regions

I’m working on a script to automate changing linetypes and linetypes of filled region sketches in Dynamo. Changing lines works great, but I’m having some trouble with the filled regions. I want to change all filled region sketch lines of Graphic Style “03_Solid_Black” to something else. So far I’ve only found a way to do this by specific filledregion type, not individual sub element graphic styles…
How can I iterate through the subelements and check their line styles? This python returns an empty list of subelements for each filled region.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application


region = FilteredElementCollector(doc).OfClass(FilledRegion).WhereElementIsNotElementType().ToElements()

out = []

TransactionManager.Instance.EnsureInTransaction(doc)

for r in region:
	z = UnwrapElement(r)
	out.append(z.GetSubelements())
TransactionManager.Instance.TransactionTaskDone()

#Assign your outputs to the OUT variable
OUT = out

Hi @jackchaskell,

There is a FilledRegion LineStyle Change node in Genius Loci package.
It might help you accomplish this task.

Ooh, thanks - I’ll have to check it out.

@Alban_de_Chasteigner this node from Genius Loci still doesn’t offer any way to filter out filled regions that don’t contain the line style I’m trying to change - it’s just taking all filled regions and changing them to a new line style…Any other ideas?
I’m not finding any method in the Revit API that will allow me to do this :frowning: