How to reduce computation in find the lowest point of a network

Hello everyone,

I am writing a a script to find the lowest point of a piping network from a floor and/or ramp in a multi-story building.
I am projecting each “bottom of pipe” point to each floor and comparing the distance. This approach works but it’s taking a lot of computational time since the building is big.
I was wondering if anyone has a better approach on the problem to reduce the nb of computations needed. Something that looks like “what is the first geometry below a certain point?”

@tmallakLPU4H ,

you can create a boundingBox and working with the min.point …

@Draxl_Andreas, Great Idea! Thanks a lot