#include <GuiConstants.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
TraySetToolTip('Revit_20/05')
HotKeySet('+{Esc}', '_Exit')
HotKeySet('{`}', 'ZoomE') ;~ Зум
HotKeySet('{F1}', 'Empty') ;~ Заглушка
HotKeySet('{F4}', 'Remem')
HotKeySet('{F6}', 'ReSite') ;~ Переименование "копия 1" в "сайт"
HotKeySet('+{F6}', 'ReSiteChange')
HotKeySet('{F7}', 'DelCopy') ;~ Удаление "... копия "
HotKeySet('+{F7}', 'DelCopyChange')
HotKeySet('{F8}', 'Duplicate') ;~ Копирование с детализацией
HotKeySet('+{F8}', 'DuplicateChange')
HotKeySet('{F9}', 'NextZE') ;~ Ctrl+Tab и ZE
HotKeySet('+{F9}', 'NextZEChange')
HotKeySet('^{w}', 'Empty') ;~ Блок Ctrl+W
Global $zX, $zY, $ReSiteCommnd, $DupCommand, $DelCopyCommand, $timesZE
$r = 0
$r2 =0
$hWnd = GUICreate("")
GUIRegisterMsg($WM_HOTKEY, 'WM_HOTKEY')
$GUI = GUICreate("", 60, 60, 1890, 42, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT, $WS_EX_LAYERED))
GUISetBkColor(0x00B510)
_WinAPI_SetLayeredWindowAttributes($GUI, 0x00B510, 0, $LWA_COLORKEY)
GUICtrlCreateLabel("•", 0, 0, 30, 30, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetColor(-1, 0x527887)
GUICtrlSetFont(-1, 40)
GUISetState()
While 1
Sleep(10)
If $r2 = 0 Then
Start()
$r2 = 1
EndIf
WEnd
Func Start()
$ReSiteCommnd =FileReadLine('Revit_Text.txt', 1)
$DelCopyCommand = FileReadLine('Revit_Text.txt', 2)
$DupCommand = FileReadLine('Revit_Text.txt', 3)
$timesZE = FileReadLine('Revit_Text.txt', 4)
MsgBox(0, "Содержимое 4-x строк", $ReSiteCommnd&@CRLF&$DelCopyCommand&@CRLF&$DupCommand&@CRLF&$timesZE,4)
EndFunc
Func ZoomE()
If WinActive('Autodesk Revit') Then
Send("ze") ;~ Эмулирует нажатие Z - E
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'ZoomE')
EndIf
EndFunc
Func Empty()
If WinActive('Autodesk Revit') Then
Beep(200,150)
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'Empty')
EndIf
EndFunc
Func Remem()
If WinActive('Autodesk Revit') Then
MsgBox(4096, "Revit_Export", " ' ====> Эмуляция Z - E"&@CRLF&"F4 ====> Напоминание"&@CRLF&" "&@CRLF&"Shift+F6 ====> Изменение F6"&@CRLF&"F6 ====> Переименование 'копия №' в 'сайт'"&@CRLF&" "&@CRLF&"Shift+F7 ====> Изменение F7"&@CRLF&"F7 ====> Удаление '.. копия ..'"&@CRLF&" "&@CRLF&"Shift+F8 ====> Изменение F8"&@CRLF&"F8 ====> Скопир с детализацией (НАВЕСТИ)"&@CRLF&" "&@CRLF&"Shift+F9 ====> Изменение кол-во F9"&@CRLF&"F9 ====> Объект по центу + Переключение"&@CRLF&" "&@CRLF&"F1 и Ctrl+W ====> Заблокированны")
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'Empty')
EndIf
EndFunc
Func ReSite()
If WinActive('Autodesk Revit') Then
Send($ReSiteCommnd);
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'ReSite')
EndIf
EndFunc
Func ReSiteChange() ; ~ Изменение Удаление
If WinActive('Autodesk Revit') Then
$tempRe = $ReSiteCommnd
$ReSiteCommnd = InputBox('Выражение 1:', "Выражение:", $ReSiteCommnd, '', 550, 120)
If $ReSiteCommnd = '' Then
$ReSiteCommnd = $tempRe
EndIf
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'ReSiteChange')
EndIf
EndFunc
Func DelCopy() ; ~ Удаление "... копия "
If WinActive('Autodesk Revit') Then
Send($DelCopyCommand);
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'DelCopy')
EndIf
EndFunc
Func DelCopyChange() ; ~ Изменение Удаление
If WinActive('Autodesk Revit') Then
$tempDel = $DelCopyCommand
$DelCopyCommand = InputBox('Выражение 2:', "Выражение:", $DelCopyCommand, '', 550, 120)
If $DelCopyCommand = '' Then
$DelCopyCommand = $tempDel
EndIf
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'DelCopyChange')
EndIf
EndFunc
Func Duplicate()
If WinActive('Autodesk Revit') Then
MouseClick('LEFT')
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'Duplicate')
EndIf
EndFunc
Func DuplicateChange()
If WinActive('Autodesk Revit') Then
$tempDupl = $DupCommand
$DupCommand = InputBox('Выражение 3:', "Выражение:", $DupCommand, '', 550, 120)
If $DupCommand = '' Then
$DupCommand = $tempDupl
EndIf
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'DuplicateChange')
EndIf
EndFunc
Func CtrlW() ; Не нужная
If WinActive('Autodesk Revit') Then
Beep(1,100)
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'CtrlW')
EndIf
EndFunc
Func Discover() ;~ Открытие выделеного вида
Send("{ENTER}")
$aMousePos = MouseGetPos()
$zX = $aMousePos[0]
$zY = $aMousePos[1]
MouseMove($zX,$zY+18)
MouseClick('LEFT')
EndFunc
Func NextZE()
$tempZE = 0
While $tempZE < $timesZE
Send("ze") ;~ Эмулирует нажатие Z - E
Send("^{TAB}")
Sleep(100)
Send("ze") ;~ Эмулирует нажатие Z - E
$tempZE = $tempZE + 1
WEnd
EndFunc
Func NextZEChange()
If WinActive('Autodesk Revit') Then
$tempZE = $timesZE
$timesZE = InputBox('Выражение 4:', "Выражение:", $timesZE, '', 100, 120)
If $timesZE = '' Then
$timesZE = $tempZE
EndIf
Else
HotKeySet(@HotKeyPressed)
Send(@HotKeyPressed)
HotKeySet(@HotKeyPressed, 'DuplicateChange')
EndIf
EndFunc
Func FirstText ()
$hFile = FileOpen('Revit_Text.txt', 2)
If $hFile = -1 Then
MsgBox(4096, "Ошибка", "Невозможно открыть файл.")
Exit
EndIf
If $r = 0 Then
FileWrite($hFile, $ReSiteCommnd&@CRLF)
FileWrite($hFile, $DelCopyCommand&@CRLF)
FileWrite($hFile, $DupCommand&@CRLF)
FileWrite($hFile, $timesZE)
$r = 1
EndIf
FileClose($hFile)
EndFunc
Func _Exit()
FirstText ()
Exit
EndFunc