First time here? Check our help page!
0

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's avatar
23
Saulius
asked 2022-07-25 03:39:33 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2023-04-22 08:10:37 -0500
edit flag offensive 0 remove flag close merge delete

Comments

@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?

Aaron Boranian's avatar Aaron Boranian (2022-07-25 12:20:33 -0500) edit

I am sharing the script for others to use.

Saulius's avatar Saulius (2022-07-26 02:27:19 -0500) edit
add a comment see more comments

1 Answer

0

As I am unable to directly insert the AutoHotkey Script Code here without formatting issues, I have uploaded it to GitHub and it can be accessed here: https://github.com/Sigmoidas/AutoHotkey-OpenStudio-Sketchup-PV-hotkeys.git

Saulius's avatar
23
Saulius
answered 2022-07-29 09:52:35 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments