AutoHotkey hotkeys script for Photovoltaics in OpenStudio SketchUp plug-in
I do plenty of solar irradiance simulations for Building Integrated Photovoltaic projects, and I primarily use OpenStudio for that task. Adding Photovoltaics onto OpenStudio Shading Groups can quickly become a tedious task. Usually there are multiple Shading Groups and they get assigned separate Electric Load Center Distribution. Therefore I developed an AutoHotkey script with Photovoltaics hotkeys to speed up the workflow. No major testing was done with it, so occasionally there is some bug in the script, and one simply needs to restart the script.
- Ctrl+Shift+Windows+P: Add Photovoltaics
- Ctrl+Shift+Windows+O: Remove Photovoltaics
- Ctrl+Shift+Windows+L: Remove Orphan Photovoltaics
The code is below in between the "*" breaklines. Cannot insert it other way as it gets mangled by the formatting style for some reason.
"*"
NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
Warn ; Enable warnings to assist with detecting common errors.
SingleInstance, force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
+^p::
If WinActive("SketchUp") { WinMenuSelectItem, , , Extensions, OpenStudio User Scripts, Alter or Add Model Elements, Add Photovoltaics SendInput, {Tab} SendInput, {Tab} SendInput, 0.13 }
Return
+^o::
If WinActive("SketchUp") { WinMenuSelectItem, , , Extensions, OpenStudio User Scripts, Alter or Add Model Elements, Remove Photovoltaics ;WinMenuSelectItem, , , Extensions, OpenStudio, Preferences } Return
+^l::
If WinActive("SketchUp") { WinMenuSelectItem, , , Extensions, OpenStudio User Scripts, Alter or Add Model Elements, Remove Orphan Photovoltaics ;WinMenuSelectItem, , , Extensions, OpenStudio, Preferences } Return
"*"
@Saulius is this a question about how to fix or improve this script, or rather announcing to other users that they can use the code from your script?
I am sharing the script for others to use.