I have written a number of OpenStudio 3.7.0 Python scripts which populate/modify an OpenStudioApp 1.7.0 .OSM file with CoilCoolingWater or CoilHeatingWater objects. The scripts also connect these coils to the respective PlantLoops and AirLoopHVACs. My intent is that I have "add" scripts which insert and connect these coils and "delete" scripts which disconnect and remove these coils. All work as expected at this point, except after running "delete" scripts, I always end up with a number of OS:Connection objects as leftovers in the .OSM file, when all I expect is the OS:Version object that I start out with before running "add" scripts. These objects look as follows:
OS:Connection,
{90c97a52-dc19-4df2-a3c1-25df6ded4921}, !- Handle
, !- Source Object
2, !- Outlet Port
, !- Target Object
2; !- Inlet Port
I would have thought that the various:
coil.removeFromPlantLoop()
coil.removeFromAirLoopHVAC()
coil.remove()
which I use in the "delete" scripts would result in a clean .OSM file, but as I say, I find these OS:Connection remnants. Also, there does not seem to be a model.getConnections() to collect and remove these separately after the fact - or at least I seem to recall there wasn't when I last tried?
Surely I am missing something, as is usually the case when I post here, but I can't figure it out. I'd welcome your thoughts, thank you.