First time here? Check our help page!
2

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

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?

__AmirRoth__'s avatar
4.4k
__AmirRoth__
asked 2016-02-13 17:35:55 -0500
edit flag offensive 0 remove flag reopen merge delete

Closed for the following reason "the question is answered, right answer was accepted" by __AmirRoth__ 2016-02-14 16:49:19 -0500

Comments

add a comment see more comments

1 Answer

1

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.

gg_student's avatar
289
gg_student
answered 2016-02-14 07:55:47 -0500
edit flag offensive 0 remove flag delete link

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 -0500) 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 -0500) 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 -0500) 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 -0500) 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 -0500) edit
add a comment see more comments