How to add measure to localBCL

asked 2023-02-17 10:48:51 -0500

updated 2023-02-20 10:51:52 -0500

How do I add a custom measure to the local BCL and make it accessible via the OpenStudio::LocalBCL methods. Let me explain with an example.

I have defined a local BCL with

path ="bcl")
mioBCL = OpenStudio::LocalBCL.instance(path)

I then create a measure with

measure_path ="bcl/testmeasure")
measureType =
new_measure ="Test", "TestClass", measure_path, "Envelope.Form", measureType, "Just a measure", "A very Cool Measure")
puts new_measure.uid

I then finally add the measure to the local BCL with


The measure is in the components.sql database, but because the folder created by addMeasure is testmeasure, and not uid/version_id, the measure cannot be found when I use


If I create the folders with the proper names and move the files there everything works as expected. The problem is that I do not know the uid and version_id before creating the measure.

Am I missing something?


Just realised that maybe a better approach is to generate the measure from OS Application, use OpenStudio::BCLMeasure.load to create the measure object and then add that object to the database.

edit retag flag offensive close merge delete