1 | initial version |
As a workaround until better support is given in the OpenStudioApplication you can do this, assuming:
model.osm
My Surface
My Plant Loop
A one liner using the CLI (it's decomposed for clarity at the end of the answer)
openstudio -e "include OpenStudio::Model; vt = OpenStudio::OSVersion::VersionTranslator.new; m = vt.loadModel('model.osm').get; s = m.getSurfaceByName('My Surface').get; pool = SwimmingPoolIndoor.new(m, s); p = m.getPlantLoopByName('My Plant Loop').get; p.addDemandBranchForComponent(pool); m.save('model.osm', true)"
It'll be missing an icon and showing some fields (the Node ones) that you shouldn't edit, but you'll have access to everything by clicking on it on the plant loop:
# Load
include OpenStudio::Model
vt = OpenStudio::OSVersion::VersionTranslator.new
m = vt.loadModel('model.osm').get
# Get Floor Surface for the pool
s = m.getSurfaceByName('My Surface').get
pool = SwimmingPoolIndoor.new(m, s)
# Connect to a plant loop
p = m.getPlantLoopByName('My Plant Loop').get
p.addDemandBranchForComponent(pool)
# Save
m.save('model.osm', true)