Color by offset value

I want to color the pipe according to the Offset value.
For example, if pipe’s offset value is -500: Blue, if pipe’s offset value is -300: Magenta.

A list is made by the offset parameter among the elements selected in the Pipe category as follows. I want to define a color by coding that classifies by each offset.


Hi @ikek102030,
Welcome to the Dynamo community.

My recommendation would be to first try using BIM One’s Color Splasher add-in.

But if you are looking for a Dynamo solution, I would do something like this:

  • Find Unique Values
  • Create Dictionary with Offset as Key and Color as Value
  • Get values at key
  • Set color

1 Like

Thank you for your nice answer, @AmolShah!

I just started Dynamo, so I try to make program that use Dynamo as more as I can.
So, I tried your Dynamo solution.
But It doesn’t work.

Here is my Dynamo code.

I stuck in Dictionary.ValueAtKey. What is cause and how to solve it?

Thank you so much.

Hi @ikek102030 …could it help you to round the number so you dont have decimals

Thank you for your helpful suggestion, @sovitek.

Thank you for answer, @Deniz_Maral.
I tried your answer and it works!
I forgot that dictionary has key and value.

Here is solution Dynamo code of my question.
Thank you guys.

1 Like