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

Revision history [back]

I was going to suggest that you use the VersionTranslator to load the model but it looks like you already tried that. When you use the VersionTranslator, errors and warnings that get logged during translation get stored in the VersionTranslator object. Try the following (psuedo-code, hopefully you get the idea):

OpenStudio.VersionTranslator translator = new OpenStudio.VersionTranslator();
OpenStudio.OptionalModel optionalModel = translator.loadModel(path); // don't call get here
translator.errors(); // loop over these and call .logMessage on each, print the message to the screen
translator.warnings(); // loop over these and call .logMessage on each, print the message to the screen

I was going to suggest that you use the VersionTranslator to load the model but it looks like you already tried that. When you use the VersionTranslator, errors and warnings that get logged during translation get stored in the VersionTranslator object. Try the following (psuedo-code, hopefully you get the idea):

OpenStudio.VersionTranslator translator = new OpenStudio.VersionTranslator();
OpenStudio.OptionalModel optionalModel = translator.loadModel(path); // don't call get here
translator.errors(); // loop over these and call .logMessage on each, print the message to the screen
translator.warnings(); // loop over these and call .logMessage on each, print the message to the screen
if (optionalModel.is_initialized()){
  OpenStudio.Model model = optionalModel.get(); // call get only if it is initialized
}

I was going to suggest that you use the VersionTranslator to load the model but it looks like you already tried that. When you use the VersionTranslator, errors and warnings that get logged during translation get stored in the VersionTranslator object. Try the following (psuedo-code, hopefully you get the idea):

OpenStudio.VersionTranslator translator = new OpenStudio.VersionTranslator();
OpenStudio.OptionalModel optionalModel = translator.loadModel(path); // don't call get here
translator.errors(); // loop over these and call .logMessage on each, print the message to the screen
translator.warnings(); // loop over these and call .logMessage on each, print the message to the screen
if (optionalModel.is_initialized()){
  OpenStudio.Model model = optionalModel.get(); // call get only if it is initialized
}