Color the objects depending on a certain conditon

I want to make a program to inspect if the objects are sited in the certain condition. I have made a program file attatched in this chat, so if there is any solution let me share your ideas.

The distance between the end of the two successive cylinders should be in the range from 5.0m to 10.0m. Somehow, a part of the cylinders is colored. I want the objects to be colored by the condition.

question.dyn (219.4 KB)

Are they dynamo objects or other objects?

If they’re Dynamo objects just use GeometryColor.ByGeometryColor node.

If they’re objects outside Dynamo there are different nodes.

Hello, here is an approach for a single point of a near cylinder

Otherwise, you have an infinite number of solutions.