PDA

View Full Version : Script to automate printing of RME Panel Schedules



truevis
2009-01-06, 12:06 AM
AutoHotKey. Uses the CutePDF driver, 11x17 size, which needs to be set up as default printer.

I have used it to print like 50 schedules, unattended.

Your mileage may vary.:shock:


;~ To automate printing of RME Panel Schedules
;~ Mouse clicks for 1280x1024 screen
#SingleInstance force
Hotkey, #x, EOF ; Allows script to be terminated with Win + X

#IfWinActive, Revit MEP
F11:: ; hotkey print panel sched to cutepdf
PPS:
Send, {F2}
WinWait, Rename View, &Name:
IfWinNotActive, Rename View, &Name:, WinActivate, Rename View, &Name:
WinWaitActive, Rename View, &Name:
Send, {CTRLDOWN}c{CTRLUP}{ESC}
WinWait, Revit MEP,
IfWinNotActive, Revit MEP, , WinActivate, Revit MEP,
WinWaitActive, Revit MEP,
Sleep, 300
Click 2
WinWaitActive, Revit
Sleep, 1000
Click 2
Send, ^p
WinWait, Print, Enter either a singl
IfWinNotActive, Print, Enter either a singl, WinActivate, Print, Enter either a singl
WinWaitActive, Print, Enter either a singl
Send, {ALTDOWN}p{ALTUP}
WinWait, Save As, http://www.CutePDF.c
IfWinNotActive, Save As, http://www.CutePDF.c, WinActivate, Save As, http://www.CutePDF.c
WinWaitActive, Save As, http://www.CutePDF.c
Send, {CTRLDOWN}v{CTRLUP}{ENTER}
Sleep, 300
WinWait, Revit MEP,
IfWinNotActive, Revit MEP, , WinActivate, Revit MEP,
WinWaitActive, Revit MEP,
Send, {ALTDOWN}w{ALTUP}h{ENTER}
; Move the mouse from its current location:
Sleep, 300
MouseMove, 0, 16,, R
Click
SoundBeep, 750, 500
Sleep, 300
return

#IfWinActive, Revit MEP
^F11:: ; hotkey print panel sched to cutepdf %UserInput% times
InputBox, UserInput, Number of Panels to print from the mouse position?, Please enter a number then click where you want to start from in the Project Browser. (You will have 4 seconds), , 800, 120
sleep, 4000
Loop, %UserInput%
{
Gosub, PPS
}
Return

EOF:
ExitApp