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

Revision history [back]

This is indeed how you load and translate a model. Here's the proper code with all necessary imports for clarity.

import openstudio

# Load an existing model
vt = osversion.VersionTranslator()
m_ = vt.loadModel("mymodel.osm")
assert m_.is_initialized, "Not a valid model"
m = m_.get()

# Translate it to IDF
ft = openstudio.energyplus.ForwardTranslator()
workspace = ft.translateModel(m)
workspace.save("mymodel.idf")

I also have a repo with a demo: https://github.com/jmarrec/OpenStudio_to_EnergyPlusAPI

Anyways, regarding your issue:

This can be disregarded

[utilities.idf.WorkspaceObject] <0> Object of type 'Schedule:Constant' and named 'Always On Continuous', points to an object named Fractional 1 from field 1, but that object cannot be located.

This is energyplus telling you there's a problem with your IDF.

**FATAL:Errors occurred on processing input file. Preceding condition(s) cause termination.

Open eplusout.err and see what the issue actually is.