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

Revision history [back]

Converting units in Openstudio using a Measure

I am trying to convert units from SI to IP. I am using the method described in this section of the documentation.

This is my code snippet:

space_items << Openstudio.convert(space.floorArea.round(8),"m^2","ft^2").get

But it returns the following error

Found error in state 'reporting_measures' with message [":/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/measure.rb failed with message Runner error :/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/measure.rb failed with uninitialized constant ExportInformationAboutEachSpaceToCSV::Openstudio, eval:283:in `const_missing'\nC:/Users/FAKEPATH/measure.rb:79

Where line 79 is the line where I am making the conversion.

Then, I did the conversion in two steps, as it is shown in the example:

area_si_units = space.floorArea.round(8)
space_items << Openstudio.convert(area_si_units,"m^2","ft^2").get

And it runs as intended. Why do I have to assign the result to a variable before using it in the convert method ?

Converting units in Openstudio using a Measure

I am trying to convert units from SI to IP. I am using the method described in this section of the documentation.

This is my code snippet:

space_items << Openstudio.convert(space.floorArea.round(8),"m^2","ft^2").get

But it returns the following error

Found error in state 'reporting_measures' with message [":/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/measure.rb failed with message Runner error :/ruby/2.2.0/gems/openstudio-workflow-1.3.3/lib/openstudio/workflow/util/measure.rb failed with uninitialized constant ExportInformationAboutEachSpaceToCSV::Openstudio, eval:283:in `const_missing'\nC:/Users/FAKEPATH/measure.rb:79

Where line 79 is the line where I am making the conversion.

Then, I did the conversion in two steps, as it is shown in the example:

area_si_units = space.floorArea.round(8)
space_items << Openstudio.convert(area_si_units,"m^2","ft^2").get

And it runs as intended. Why do I have to assign the result to a variable before using it in the convert method ?