@OldCoot – The AHK script is under. Take cautious be aware of the feedback. Numerous that is onerous coded to work with my setup, so you might must make changes. Use at your personal danger.
; AlignTrays – Align Trays
; I’ve to run in administrator mode for this to work with Sketchup 2023
;
; That is arrange for 3 displays.
; My show decision is 2560×1440
; You’ll have to regulate defW/defH variables under on your display screen
; This script additionally assumes the middle show is the first monitor,
; with the left monitor having detrimental coordinates, the middle monitor beginning at 0, 0,
; and the fitting monitor beginning on the show width coordinate.
#NoEnv ; Beneficial for efficiency and compatibility with future AutoHotkey releases.
#Warn ; Allow warnings to help with detecting frequent errors.
#Singleinstance drive
;SendMode Enter ; Beneficial for brand spanking new scripts attributable to its superior pace and reliability.
;SetWorkingDir %A_ScriptDir% ; Ensures a constant beginning listing.
;————–CRITICAL INFO——————-
;I’m working with the next custom-made SketchUp trays:
;T1 (SU Tray 1)
;T2 (SU Tray 2)
;T3 (SU Tray 3)
;Mannequin Information (SU mannequin data)
;Profile Dialog (profile builder dialog)
;set AHK definitions
;Use Alt+F9 to align left, Alt+F10 to align middle, Alt+F11 to align proper
!F9::AlignTrays(1)
!F10::AlignTrays(2)
!F11::AlignTrays(3)
AlignTrays(mon)
{
; Get the system settings for obtainable monitor house
SysGet, m, Monitor, %mon%
defW := 447 ; default width of the trays, alter as wanted to your monitor decision
defT := 30 ; This may be set to zero, however I want an offset on the high as a result of I’ve WinStep loaded and it takes up some high house.
defH := 1100 ; default top of trays, alter to your monitor decision
if (mon = 1)
{
x1 := (mRight – defW)
}
else
{
x1 := (mLeft)
}
; set the the place of T1, every little thing else aligns with it.
; the +10 was added right here to resize the window to work round a SketchUp bug.
; the subsequent line could be eliminated as soon as SU fixes the bug
WinMove, T1, %x1%, %defT%, defW+10, 1100 ; take away when bug is mounted
WinMove, T1, %x1%, %defT%, defW, 1100
WinGetPos, x, y, w, h, T1
; some changes to get coordinates to align.
; the sketchup trays don’t report window sizing the identical as different home windows, so needed to alter
if (mon = 1)
{
x1 := x – defW – 1
}
else
{
x1 := x + defW + 1
}
y := defT + 1
; transfer and measurement tray 2 equal to tray 1
; the +10 was added right here to resize the window to work round a SketchUp bug.
; the subsequent line could be eliminated as soon as SU fixes the bug
WinMove, T2, x1, y, defW+10, h ; take away when bug is mounted
WinMove, T2, x1, y, defW, h
if (mon = 1)
{
x1 := x1 – (defW – 1)
}
else
{
x1 := x1 + (defW + 1)
}
; transfer and measurement tray 3 equal to 1 and a couple of
; the +10 was added right here to resize the window to work round a SketchUp bug.
; the subsequent line could be eliminated as soon as SU fixes the bug
WinMove, T3, x1, y, defW+10, h ; take away when bug is mounted
WinMove, T3, x1, y, defW, h
; transfer mannequin data to new coordinates
if (mon = 1)
{
WinGetPos, x, y, w, h, Mannequin Information
x1 := (x1 – w + 6)
}
else
{
WinGetPos, x, y, w, h, T3
x1 := (x1 + w – 6)
}
y := defT – 1
WinMove, Mannequin Information, x1, defT
WinGetPos, x, y, w, h, Mannequin Information
if WinExist(“Profile Dialog”)
{
; alter coordinates for profile builder
y := h + 24
h := defH – h + 12
; transfer profile builder dialog beneath mannequin data
WinMove, Profile Dialog, x, y, w, h
}
}