Boundingbox Intersections background project _ Python

Hello everyone,

Can anyone help me with a Python script.
I would like to retrieve the boundingbox intersections from a model opened in the background.

The script works perfectly with the source file open, but when I open it in the background I get Empty values.

I suspect that the Python script refers to the active project and not the project opened in the background.

Anyone any idea how to fix this?

@Nick_Boyts @JacobSmall @Marcel_Rijsmus @Vikram_Subbaiah maybe?

Thanks in advance!

You are correct.

Annotate your code and the issue will become clear. Put a # at the end of each line and write out what the line does. As an added bonus you’ll learn more of what is happening.

As a hint the problem starts around line 14.