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 2022-07-25 03:39:33 -0600

Saulius's avatar

updated 2023-04-22 08:10:37 -0600

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

"*"

edit retag flag offensive 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 -0600 )edit

I am sharing the script for others to use.

Saulius's avatar Saulius  ( 2022-07-26 02:27:19 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-07-29 09:52:35 -0600

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

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

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2022-07-25 03:36:33 -0600

Seen: 173 times

Last updated: Jul 29 '22