I’ve created a script that opens a file, selects a region, deletes everything else, and saves it, and it works fine when I execute it using the rhino command line or pasting it in command prompt (still opens up the gui) but if I run it with python using os.system or subprocess it runs in the background and doesn’t finish executing the script.
If I use different script commands like ‘SelSrf Delete SaveAs’ it runs properly in the background, but maybe there is something about the SelCircular command that won’t run without a gui?
As fas as I understood, things like SelWindow, SelCircular etc. are pixel-based and thus may not do anything without the selection boundary actually on-screen.
I would approach it from another direction, that is how to find objects inside a volume (geometrically) without having to have anything showing on the screen. That is what the script does in the other thread you posted on a similar subject…
One cheap (script-wise) method is to mesh each object and check each mesh vertex if it is inside the volume; if one is found that isn’t, remove the object from the selection and go to the next one. It may be computationally expensive with large numbers of objects.