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

SketchUp Measure Multiplier to Selected Thermal Zones

asked 2019-10-14 15:07:37 -0500

updated 2020-01-18 10:14:02 -0500

I am attempting to write a Sketchup Measure that takes the selected Thermal Zones and applies a Multiplier to them from a user input.

The code is below but I am having two problems:

  • (Solved) I am getting an end-of-file error that I can't figure out.
    • I discovered that a next if does not require an end.
  • Defining the multiplier to the thermal zone is not working. I don't believe my method is correct.

I iterate through each thermal zone and try to override the multiplier using:

thermal_zone.multiplier = 2

Is this the correct method or does it operate more like:

thermal_zone.multiplier(2)

I have also tried:

thermal_zone.setMultiplier(2)

My code can be found here GitHub

EDIT 10/15/2019

The script is now working and can be found at the above GitHub link. The solution was a combination of factors. @Julien Marrec answer below helped find several errors and troubleshoot.

The biggest mistake was that it doesn't appear the runner.isSelection() works on thermal zones in SketchUp as the interface is highlighting spaces, not thermal zones.

Instead, I had to use the runner.isSelection() on a space and then get the thermal zone for that space. After getting the thermal zone I could use the .setMultiplier(int) function that @Julien Marrec highlighted.

edit retag flag offensive close merge delete

Comments

It probably depends on what Rendering mode you're in. If you switch to Render by Thermal Zone, it probably selects thermal zones. (you can see what the inspector shows...)

Julien Marrec's avatar Julien Marrec  ( 2019-10-15 15:22:00 -0500 )edit

That is a really good tip! I didn't realize that render by thermal zone would select the thermal zones. I'll try another script that takes this into account.

JustinShultz's avatar JustinShultz  ( 2019-10-15 15:30:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2019-10-14 16:06:40 -0500

updated 2019-10-14 16:11:08 -0500

The SDK Documentation is your friend. See ThermalZone:

bool openstudio::model::ThermalZone::setMultiplier(int multiplier)

From a cursory look, on line 71 you aren't using the right method either, you have a typo here, registerAsNotApplication:

virtual void openstudio::measure::OSRunner::registerAsNotApplicable     (   const std::string &     message )

SDK doc for OSRunner

edit flag offensive delete link more

Your Answer

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

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2019-10-14 15:07:37 -0500

Seen: 117 times

Last updated: Oct 15 '19