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

Is it possible to call one measure from another? [closed]

asked 2016-02-13 17:35:55 -0600

It looks like this is not possible because requiring measure A from measure B essentially causes measure A to be run when measure B is called. Am I missing something?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by __AmirRoth__
close date 2016-02-14 16:49:19.808796

1 Answer

Sort by » oldest newest most voted
1

answered 2016-02-14 07:55:47 -0600

gg_student's avatar

I don´t know if it is possible by another measure. But perhaps you can translate this code to ruby, then you can use the measure, add some arguments etc. and run it:

OpenStudio.Path Path = new Path("YourMeasurePath");
BCLMeasure.load(Path);

or:

OpenStudio.Path Path = new Path("YourMeasurePath");
BCLMeasure measure = new BCLMeasure(Path);
measure.doSomething();

I think it would be possible to read a Path in a Measure and load it to OS.

edit flag offensive delete link more

Comments

Ok ... this is promising. I have the measure loaded. But BCLMeasure does not have a run method and I actually need to execute this bad boy. What is the secret handshake for executing a measure once loaded?

__AmirRoth__'s avatar __AmirRoth__  ( 2016-02-14 10:32:56 -0600 )edit
1

That´s the same problem I have. See: Run Measure. I now use the normal way. When it is loaded to OpenStudio it will run the measure, when simulation is started. But when you work in the measure for itself, you write it with ruby, yes? Therefore you have a run-Methode. You will see in the Link.

gg_student's avatar gg_student  ( 2016-02-14 11:03:01 -0600 )edit

OK, so you can't do this in a generic/meta way (I wonder why not). I will try it the other way. Thanks.

__AmirRoth__'s avatar __AmirRoth__  ( 2016-02-14 11:34:25 -0600 )edit

@gg_student : can you get measure list from My measure folder ? i wonder it should be somewhere.

ngkhanh's avatar ngkhanh  ( 2016-02-14 12:44:28 -0600 )edit

@gg_student, the pointer to the previous question was what I was looking for. Thanks!!

__AmirRoth__'s avatar __AmirRoth__  ( 2016-02-14 15:36:41 -0600 )edit

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2016-02-13 17:35:55 -0600

Seen: 147 times

Last updated: Feb 14 '16