STL empty on export (Python API) When I export manually I get the full STL but when I try using the Python API I get 1k (ie empty) files.

The code is quite complex (which I'm not a liberty to share at the moment) but its final piece is called Boundary 

I execute the following lines of code to export the STL,

bpy.context.scene.objects.active = Boundary
bpy.ops.export_mesh.stl(filepath="C:/Users/User/Documents/Pyticle/Volume Blender/Bob.stl")


I saw some previous questions asking this but they all suggested that the geometry was not selected which is not the case here. That is unless I'm not selecting it properly?

(An aside, a decent NURBS interpreter, that is all)
It’s going to be hard to answer with so few info… STL exporter by default export all (geometry) object in active scene (only exporting selected ones is an option, disabled by default).

That said, here are some ideas to check:


Active is not selected, those two states are different and you may have an active but non-selected object (so you should also ensure you do Boundary.select = True in case you export only selected).
Your object must be linked in the active scene (context.scene.objects.link(Boundary)), otherwise you can select it or even (try to!) make it active, it won’t work.