First time here? Check out the Help page!

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 9 years ago

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?

Preview: (hide)

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 9 years ago

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.

Preview: (hide)
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__  ( 9 years ago )
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  ( 9 years ago )

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__  ( 9 years ago )

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

ngkhanh's avatar ngkhanh  ( 9 years ago )

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

__AmirRoth__'s avatar __AmirRoth__  ( 9 years ago )

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 165 times

Last updated: Feb 14 '16