@mldichter I just documented the current behavior in an issue; the current behavior is not ideal. I do have some possible work arounds for now.
If you assign a variable to the results of addObjects
and check if that is empty, that will indicate one or more objects have an issue that prevented the objects from importing. When you see this happen, you can add a puts statement of the workspace that addObjects
is being called on.
source_idf = OpenStudio::IdfFile::load(OpenStudio::Path.new(source_idf_path)).get
puts source_idf
You can then diff that with the original IDF file.
There is also an addObjet
method you could use that does bring in the object even if invalid, the issue above describes how to use this. This would then result in a simulation error at run time that might point to the problem object.
Either way, the IDF will need to be updated if there are IDD changes in EnergyPlus and you want to use it with newer version of OpenStudio/EnergyPlus. We don't currently have any measures that run the EnergyPlus version updater. The "InjectIdfObjects" measure takes a user specified file. If a measure gets IDF files from a resource folder, it could be good to add min/max version tags to the measure matching which version of EnergyPlus is supported for the objets in the IDF. You could also have multiple IDF objets for different EnergyPlus versions that will get selected based on what version of OpenStudio the measure is being run on.