Script to get objects inside or outside a boundary polysurface

I have a very large context model of a city (includes curves and surfaces) and would like to extract a portion of it using a script. I’m able to generate a cylinder using python given a set of coordinates and radius, but I haven’t been able to find a good method of isolating the geometry within that cylinder.

I’ve found prior posts like this one about doing this with planar curves but nothing with surfaces. Does anyone know of a good way to script getting objects inside or outside a boundary?

We discussed this recently - you could try SelVolumeObject (native in Rhino). If that doesn’t get all you think it should, you can have a look at this script - it may be somewhat slow with many, many objects. It is designed to work by selecting a pre-existing volume (object in the Rhino document), but it could be modified to generate a volume internally.

SelObjsInsideSolidV4.py (11.7 KB)

Note in passing that if it is something like a city model, you could possibly use SelBoundary with just a closed curve from top view.

I was able to use a script to run SelCircular with the coordinates and radius and it works when I run it through an open rhino session, but if I try to run this using a python subprocess.callI() or os.system() command it gets stuck. It executes fine if I use different commands (SelAll, Delete, SaveAs for example works fine) maybe there’s something about the SelCircular command where it gets stuck?

_-SelCircular
S
C
1000,1000
1000
_-ExportWithOrigin
test.3dm
_-Exit