SketchUp Measure Multiplier to Selected Thermal Zones
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.
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...)
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.