Highlighting a BIM element by color coding the model in Dynamo

Dear friends

For highlighting an object in my Revit file when one of its parameters exceeds a predefined threshold value, I wrote a color code in a code block. I want it to be highlighted in Red, whenever its parameter exceeds a value and returns to its initial color when the parameter’s value becomes less than the predefined value. But it doesn’t work and it highlights into gray. and in case of any other changes, it remains gray. I attached a picture to show it. Any help and guidance is appreciated. Thank u so much

@MOJTABA256 in that case, if you have a given condition, you must use ‘filterbyboolmask’ after that condition to filter out elements that satisfies the given condition. see sample below.

1 Like

@MOJTABA256 RGB values of 128,128,128 is a grey and that is the color returned by your node (as the value of x seems to be 0.000002, which is less than 0.0008)

If you want it to turn red, either ensure that x > 0.0008 or make a change in the code block ( to x<0.0008)


Thank u so much for your guidance. It worked. But do you know how to highlight the element which is attached to this object. For example in the picture attached above,the object in gray color is attached to another element at its bottom. Do you have a sample to show which nodes I should use to highlight the element to which this object is attached whenever its parameter value exceeds the predefined threshold value. I mean instead of highlighting the object (in gray color in above picture), I want to highlight the element to which it is attached. Thank u so much in advance

Thank u so much Vikram. Yes you were right. I changed it to (255, 255, 0 , 0) and followed the nodes as shared by @rexfrancojesse, and it worked as shown in the attached picture. As shown in the picture, the code block says that if x>0.0008 change its color to red. When I put a value like 0.000802, the object will be highlighted in Red, but after if I changed the value to 0.00079, the object will be still highlighted in Red and its color does not change to its initial condition. Do you know how to solve this issue? I showed them in the pictures below. Thank u so much

1 Like

Not to piggyback off of the original question…how would you modify the code block to only color an element when it is between certain values (greater than or less than)?

Example: if I only want to color the element when its value is between 0.0004 and 0.0008

(Also, @MOJTABA256, one solution would be to use the ResetOverridesinView node and then running your dynamo again to color red)