Filtering ducts from a list of section (code block)

hello,
here’s my script. i’m trying to put on a yes/no parameter to “highlight” my critical path.
the purpose is to make a schedule of all the ducts, ducts fitting accessories and air terminals of the critical path.
right now my script activate the parameter of all the ducts of the selected system.
the part with the “mep curve connected fitting” is secondary for the moment

.