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

Problem in openstudio measure in 3.4

asked 2022-09-11 04:30:21 -0500

updated 2022-09-11 07:49:14 -0500

I an having problems with a measure that used to work fine in openstudio app 2.9 but now in some cases is failing in 3.4.

the problem appears when I call the uFactor method of a subsurface object from a measure. For example, when i call

window.uFactor

I get the the following error:

Result: Fail
Error: Error creating prepared statement: SELECT Value from TabularDataWithStrings
WHERE ReportName = 'EnvelopeSummary'
AND ReportForString = 'Entire Facility'
AND TableName = 'Exterior Fenestration
AND ColumnName = 'Glass U-Factor'
AND Units='W/m2-K'
AND RowId = ?; with error code 1, extended code 1, errmsg: near "Glass": syntax error
C:/Users/EFINOV~1/AppData/Local/Temp/osmodel-1662883600-0/resources/measures/verificacion_ctehe1_2019/measure.rb:1370:in `uFactor'

There are a few funny things: - It never fails in a ruby script inside sketchup - In an openstudio measure fails in some cases. I guess it depends on the glass construction name or the construction set name, but after several tries with different names I couldn't reach any conclution.

Any ideas?

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-09-12 01:58:27 -0500

I have found a work arround. I have noticed that at the begginig of the run method there is no problem getting the uFactor of the windows. So, I have injected a new uFactor2 attribute to all subSurfaces instances with the uFactor value, and then in the following code I call the uFactor2 attribute instead of the uFactor method:

   model.getSurfaces.each do |s|
        s.class.module_eval { attr_accessor :uFactor2}
        s.uFactor2 = s.uFactor    
    end

It is not very clean but it works.

edit flag offensive delete link more
1

answered 2022-09-11 21:39:33 -0500

We update the measure as need for new versions of OpenStudio and EnergyPlus. Going from OpenStudio 2.x was a big change, and for reporting measures SQL queries change with different versions of OpenStudio. If you are using an GUI like the OpenStudio Application or PAT, they offer a way to check for measure updates. if you are not you can get them from the BCL link here, or also from the source GitHub repos.

edit flag offensive delete link more

Comments

Thanks for your answer. In my case it is a self made reporting measure for verifying compliance with energy efficiency spanish regulation.

mapascual's avatar mapascual  ( 2022-09-12 01:29:11 -0500 )edit

Just to point it out, in the error message, in the prepared statement there is a missing ' after Exterior Fenestration.

That would explain the problem, but doesn't explain why it only happens in some cases.

mapascual's avatar mapascual  ( 2022-09-12 01:52:48 -0500 )edit

Good catch, I agree that that is causing the error. I filed a bug report: https://github.com/NREL/OpenStudio/is...

shorowit's avatar shorowit  ( 2022-09-12 10:40:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Question Tools

1 follower

Stats

Asked: 2022-09-11 04:30:21 -0500

Seen: 83 times

Last updated: Sep 12