Revit - Parts - Random material

Good morning All (or Good Afternoon/Evening depending on a Time Zone),

I am currently working on a graph that assigns random material to selected Parts elements.
I have been trying to utilise my previous graph that did the same for Panels within Curtain Walls.

As you can imagine it is not working out ergo the cry for help.

Here is the graph below with a strange warning in both nodes - Selection and Set Parameter - please see below.

Any help greatly welcome!


You should run the script in proper document. Looks like your running your graph in another rvt file. That’s the reason you get this error.

Not really sure what you mean. I did run this script in the very same RVT file. Although, truth be said, in a view through Isolate Element/s - though still not sure if this matters.
I’ve run a couple of different selections and this is still happening.

Here is a pic of the selection in question:

What are these elements?

Parts. I’ve turned an external wall into Parts and then split them along Ref planes - see the below pic:

I’ve also tried another node, yet again unsuccesfuly - getting slightly frustrated with my own limitations.

@M4RC3L Don’t worry could you drop here your rvt file.

@M4RC3L I just did a quick test and it works fine for me:

Use OOTB node SetParameter.ByName and feed Material not string:

1 Like


Thank you.
You are a star!

It does work now - see the below:

What’s left for me now to do, is a graph that allows me to filter very specific Parts out of a selection of elements, based on their Original Type parameter.
Let’s hope it will be slightly easier to do than today’s exercise!

Thanks again.

You’re welcome! Please mark the post as solved .

1 Like