Change Material of duct or pipe system with dynamo

I’m doing a rendering using Enscape of a large project which is made up of several M&E models.
To save time I’d like to create a dynamo script which changes the assigned material of all ducting systems to a material of my choice.
I cant however figure out how to interact with piping and ducting systems through dynamo.

Hi @filipe.dias ,

What have you tried so far in Dynamo?

So it looks like I’ve got it to do what I wanted but now another hurdle.
It appers that it changes all the system materials when I look at the “Parameter.ParameterByName”, however when I look at the systems in Revit, not all have changed material. Any idea what would be causing this behaviour. (Happens to both ducting and piping systems)

Okay I’ve figured out that it will not change the material if there is not an element in the model with the assigned system. So if there is no duct with the “General Supply” system assigned to it, the material of general supply will not be updated.

Any idea how to get around this?

There is a big difference in Revit, and in its extent Dynamo, between FamilyInstances and FamilyTypes.
With the script you showed in your screenshot you are only updating type parameters on family types (which is the right way btw).

To update ALL piping families you’ll have to import all families, and their family types.

Thanks @Daan, could you elaborate on how I’d go about doing that?

Clockwork has a node specifically to do this :smiley: :

So instead of getting all elements of your specified category you directly request all families loaded in the project within that category.

Thanks @Daan

Managed to get it working:

1 Like