Dynamo script for Identifying whether the slope is correct according to the type of system and pipe size and give the pipes a color


COOD.pdf (78.5 KB)
Hi
need some help .
I wrote a code (Honestly I used ChatGPT to write the python code) to check the correctness of the slope according to the system type of the pipe and the size of the pipe.
The problem is that it doesn’t recognize the slope as it should, some it does recognize and some it doesn’t, or it suddenly marks the vertical pipe as correct.
Where is my mistake?

The first thing I notice is that you don’t maintain your list in both branches. You filter the pipes based on the python output but then choose the color based on all outputs. Those lists don’t match anymore. If you’re applying a color for true and false valued elements then you don’t need to filter.