; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: AK ; ; Script Function: ; Quick toolbar for Autocad that appears right under the mouse pointer. ; ; Usage: ; Change shortcuts at the end to reflect your Autocad setup (some of these ; commands don't have a shortcut by default, some are changed from default). ; Press Xbutton1 and while holding it, move to needed button while in ; Autocad window. ; ; Notes: ; Xbutton can be changed in the code, for example to right button or to ; ctrl-left button or to a keyboard shortcut. ; The script can be easily changed to click a second time on a button ; instead of hold & release. ; mkAcadGui: amenu = 0 SetTitleMatchMode, 2 gosub AcadInit Gui, 3: +ToolWindow -Caption ; to remove top portion with minimize button etc Gui, 3: Font, S7 CDefault, Verdana Gui, 3: Add, Button, x6 y0 w32 h20 +BackgroundTrans gacadAction, Mv Gui, 3: Add, Button, x38 y0 w32 h20 +BackgroundTrans gacadAction, Cp Gui, 3: Add, Button, x80 y0 w52 h20 +BackgroundTrans gacadAction, Stretch Gui, 3: Add, Button, x132 y0 w42 h20 +BackgroundTrans gacadAction, Offset Gui, 3: Add, Button, x184 y0 w34 h20 +BackgroundTrans gacadAction, Trim Gui, 3: Add, Button, x218 y0 w44 h20 +BackgroundTrans gacadAction, Leader Gui, 3: Add, Button, x268 y0 w22 h20 gacadX, X Gui, 3: Add, Button, x6 y22 w52 h20 +BackgroundTrans gacadAction, ZmExt Gui, 3: Add, Button, x68 y22 w24 h20 +BackgroundTrans gacadAction, En Gui, 3: Add, Button, x92 y22 w32 h20 +BackgroundTrans gacadAction, Esc Gui, 3: Add, Button, x134 y22 w44 h20 +BackgroundTrans gacadAction, Osnap Gui, 3: Add, Button, x178 y22 w52 h20 +BackgroundTrans gacadAction, Extend Gui, 3: Add, Button, x238 y22 w52 h20 +BackgroundTrans gacadAction, Del Gui, 3: Add, Button, x6 y44 w42 h20 gbuttonZmin , Zmin Gui, 3: Add, Button, x58 y44 w32 h20 +BackgroundTrans gacadAction, Dim Gui, 3: Add, Button, x90 y44 w32 h20 gbuttonDist , Dist Gui, 3: Add, Button, x132 y44 w42 h20 +BackgroundTrans gacadAction, Mirror Gui, 3: Add, Button, x174 y44 w52 h20 +BackgroundTrans gacadAction, MatProp Gui, 3: Add, Button, x236 y44 w52 h20 +BackgroundTrans gacadAction, Line Gui, 3: Add, Button, x6 y76 w42 h20 +BackgroundTrans gacadAction, Ortho Gui, 3: Add, Button, x48 y76 w42 h20 +BackgroundTrans gacadAction, Polar Gui, 3: Add, Button, x100 y76 w42 h20 +BackgroundTrans gacadAction, Undo Gui, 3: Add, Button, x152 y76 w52 h20 +BackgroundTrans gacadAction, TextEd Gui, 3: Add, Button, x204 y76 w62 h20 +BackgroundTrans gacadAction, Deselect Gui, 3: Add, Button, x6 y98 w42 h20 +BackgroundTrans gacadAction, Hatch Gui, 3: Add, Button, x58 y98 w42 h20 +BackgroundTrans gacadAction, Model Gui, 3: Add, Button, x100 y98 w44 h20 +BackgroundTrans gacadAction, Layout Gui, 3: Add, Button, x152 y98 w44 h20 +BackgroundTrans gacadAction, Rotate Gui, 3: Add, Button, x196 y98 w32 h20 +BackgroundTrans gacadAction, Pan Gui, 3: Add, Button, x238 y98 w42 h20 gbuttonColor , Color Gui, 3: Add, Button, x16 y120 w42 h20 +BackgroundTrans gacadAction, Close Gui, 3: Add, Button, x58 y120 w42 h20 +BackgroundTrans gacadAction, Save Gui, 3: Add, Button, x100 y120 w42 h20 +BackgroundTrans gacadAction, Print Gui, 3: Add, Button, x172 y120 w34 h20 +BackgroundTrans gacadAction, Rect Gui, 3: Add, Button, x206 y120 w52 h20 +BackgroundTrans gacadAction, Explode Gui, 3: Add, Button, x5 y142 w55 h20 +BackgroundTrans gacadAction, Windows ; Generated using SmartGUI Creator 4.0 Gui, 3: Color, 777777 Gui, 3: +LastFound ; Make the GUI window the last found window. WinSet, TransColor, 777777 ; make window transparent return ;Rbutton: ; Click ;Return Autocad() { global amenu if (amenu = 1) { send, {Lbutton down}{Lbutton up} amenu = 0 } else if (amenu = 0) { ; First test if Autocad is active IfWinNotActive, CAD 200 { Send {Rbutton} return } ; Second test if mouse is inside Autocad window WinGetPos wx, wy, width, height, CAD 200 MouseGetPos sx, sy if ((sx < 0) or (sy < 0) or (sx > width) or (sy > height)) { Send {Rbutton} return } ; Create the xbutton1 up shortcut that will click on the chosen button ; Hotkey, Rbutton Up, Rbutton_Up CoordMode, Mouse, Screen MouseGetPos x, y ; Put mouse on top of Enter button - this allows to click and release immedia- ; tely to press Enter nx := x-78 ny := y-28 Gui, 3: Show, x%nx% y%ny% h165 w307, AutoCAD 2006 quickmenu amenu = 1 } } return acadX: GuiClose: Gui, 3: Hide return ButtonColor: Gui, 3: Hide send COLOR{Enter} sleep 1000 return ButtonDist: Gui, 3: Hide send dist{Enter} return ButtonZmin: ; SetTitleMatchMode, 2 Gui, 3: Hide Send ^+5 return AcadAction: Gui, 3: Hide shcut := % %a_guicontrol% ; MouseMove x, y sleep 10 send %shcut% return AcadInit: Offset = ^+e Rect = ^+{F7} Hatch = ^!1 Ortho = ^!1 Polar = ^!1 Layout = layout{Enter}{Enter}{Enter} Model = model{Enter} Color = color{Enter} Save = ^s Close = {Esc}close{Enter} Print = ^p En = {Enter} Esc = {Escape} Line = ^+{F5} Mv = ^+h Cp = ^+g Del = {Delete} Mirror = ^+b Deselect = ^{F12} Rotate = ^+{F12} Stretch = ^+a Trim = ^+m Extend = ^+l ZmExt = ^+q Leader = ^+z Undo = ^z Dim = ^+j Osnap = ^f TextEd = ^+k Pan = {F7} Explode = ^+!c MatProp = ^+o Windows = !w return