Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

openstudio::model::saveModel is a function that's more meant for the OpenStudio Application (somewhat of a leftover after separating the OpenStudio Application from the OpenStudio SDK). It will copy the model and the companion directory (tif your model is named mymodel.osm, that's the directory mymodel/ next to it) to another location. The third parameter is a path to that temporary directory, it cannot be empty.

Anyways, you likely don't want to use it at all. You should use openstudio::model::Model.save(path, overwrite = false)

import openstudio
model = openstudio.model.Model()
model.save("model.osm", True)
# or
from pathlib import Path
m.save(Path('mymodel.osm'), True)

openstudio::model::saveModel is a function that's more meant for the OpenStudio Application (somewhat of a leftover after separating the OpenStudio Application from the OpenStudio SDK). It will copy the model and the companion directory (tif (if your model is named mymodel.osm, that's the directory mymodel/ next to it) to another location. The third parameter is a path to that temporary directory, it cannot be empty.

Anyways, you likely don't want to use it at all. You should use openstudio::model::Model.save(path, overwrite = false)

import openstudio
model = openstudio.model.Model()
model.save("model.osm", True)
# or
from pathlib import Path
m.save(Path('mymodel.osm'), model.save(Path('mymodel.osm'), True)

openstudio::model::saveModel is a function that's more meant for the OpenStudio Application (somewhat of a leftover after separating the OpenStudio Application from the OpenStudio SDK). It will copy the model and the companion directory (if your model is named mymodel.osm, that's the directory mymodel/ next to it) to another location. The third parameter is a path to that temporary directory, it cannot be empty.

Anyways, you likely don't want to use it at all. You should use openstudio::model::Model.save(path, overwrite = false)

import openstudio
model = openstudio.model.Model()
model.save("model.osm", True)
# or
from pathlib import Path
model.save(Path('mymodel.osm'), True)

This method is inherited from Workspace: SDK docs