Revit + dynamo - Color rebar based on the partition parameter - example 16

Picture 1: Result

0. Intro

Sometimes it’s very nice to be able to see the different kinds of rebars based on their partition, and not just rebar size when checking the model for errors. Here we will do just that!

1. Select all rebar elements in view

First thing, hide the rebars you don’t wanna “paint” and then open up the dynamo script. We want to select all our structural rebars in the active view we have open, will do that with the nodes Document.Current and document.activeView, and the costume node Springs.Collector.ElementinView. Now all the rebars in the active view are selected in dynamo, and we are ready to proceed to the next step.

Picture 2

2. List breakdown

Not a completely necessary step, but choose to split up the list into 3 lists, to avoid partition close to each other to get to of a similar color. Since we separate it from the list, 3 partitions will get the same color, but it will be more spread. This means, for example, that partition 11 and 12 will have a larger color difference, but partition 11 and 26 will have the same color.

Picture 3

3. Color palette

Create a larger color palette by adding in a total of 6 colors to choose from. Se the color range in the image.

Picture 4


The costume node Color.ByParameter is used to apply color to the element based on their chosen parameter, in this case, we want to separate the different elements by a partition, so each partition in the chosen category (structural rebars) will get a color from the color palette created in the previous section. 

If you want to reset or delete colors on the structural rebars, set boolean to true, and run the script again.

For more information on this costume node, click the link below:

Picture 3

5.Video demonstration