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

AutoHotkey hotkeys script for Photovoltaics in OpenStudio SketchUp plug-in

asked 2 years ago

Saulius's avatar

updated 1 year ago

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

"*"

Preview: (hide)

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

I am sharing the script for others to use.

Saulius's avatar Saulius  ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 2 years ago

Saulius's avatar

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

Preview: (hide)
link

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2 years ago

Seen: 196 times

Last updated: Jul 29 '22