I know that this question is so incredibly simple but I have been scouring this forum and looking through OpenStudio measures for the last hour without any luck.
I have a .osm file that I have created and saved and I want to turn this .osm file into an OpenStudio Model Object so that I can edit it with OpenStudio SDK. I see that I can initialize a model object from an IDF file but there doesn't seem to be a class method for initializing such a model object from an .osm.
I am sure that there must be a way but it's hiding in plain sight from me. I am using OpenStudio C# bindings but any example code that uses the OpenStudio SDK would be a great answer.
Thank you,
UPDATE: I realized something hiding in plain sight: there's a load() method under 'Static Public Member Functions' in the page that I linked to, which seems to be made for converting .osm files to model objects. However, the following code is still returning an empty model for me:
import OpenStudio
osmPath = "C:\MyModels\model.osm"
model = OpenStudio.Model()
model.load(OpenStudio.Path(osmPath))
SOLVED: This code finally worked for me:
import OpenStudio
osmPath = "C:\MyModels\model.osm"
model = OpenStudio.Model().load(OpenStudio.Path(osmPath)).get()