STL empty on export (Python API)
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.