Hello,
There is a bug in AHK in combination with AutoCAD. All <Alt> send commands are blocked after using the the command acad.ActiveDocument.SendCommand
The script stops at the <Alt> send command.
Can you confirm this.
Here is to AHK code to test on:
-----------------------------------------------------------------------------
#s:: ; Windows key + s (hotkey)
acad := ComObjActive("AutoCAD.Application")
Send {Sleep 50}
acad.ActiveDocument.SendCommand("_commandlinehide`n")
Send {Sleep 50}
Send !J ; Alt functions aren't working after the command acad.ActiveDocument.SendCommand
Return
-----------------------------------------------------------------------------
Bug with <Alt> send commands
Re: Bug with <Alt> send commands
There is a topic on this in the AutoCAD forum:
https://forums.autodesk.com/t5/autocad-forum/keyboard-shortcuts-alt/td-p/2139188
It looks like it is by design in AutoCAD.
Removing the two lines given below from the script and using <Alt> functions, it will work then in the whole script.
acad := ComObjActive("AutoCAD.Application")
acad.ActiveDocument.SendCommand("_commandlinehide`n")
It would be nice if AHK could find a solution or a workaround to use the <Alt> button with the two lines above. I want to use the .SendCommand line in the script, because it is easier and faster.
https://forums.autodesk.com/t5/autocad-forum/keyboard-shortcuts-alt/td-p/2139188
It looks like it is by design in AutoCAD.
Removing the two lines given below from the script and using <Alt> functions, it will work then in the whole script.
acad := ComObjActive("AutoCAD.Application")
acad.ActiveDocument.SendCommand("_commandlinehide`n")
It would be nice if AHK could find a solution or a workaround to use the <Alt> button with the two lines above. I want to use the .SendCommand line in the script, because it is easier and faster.
Re: Bug with <Alt> send commands
I can't help with the problem, as I don't have AutoCAD, but a few remarks:
• Send {Sleep 50} sends the sleep key 50 times, it doesn't wait 50 milliseconds. Depending on your send mode it may take a lot mode or less time, and possible trigger other things.
• Send !J sends Alt+Shift+j, also probably not what you intend.
To troubleshoot; do the alt hotkeys also fail when you perform them manually? Does it make a difference if you change focus to a different gui element or minimize restore the gui?
Mod edit: Moved from Bug reports to Ask for help.
• Send {Sleep 50} sends the sleep key 50 times, it doesn't wait 50 milliseconds. Depending on your send mode it may take a lot mode or less time, and possible trigger other things.
• Send !J sends Alt+Shift+j, also probably not what you intend.
To troubleshoot; do the alt hotkeys also fail when you perform them manually? Does it make a difference if you change focus to a different gui element or minimize restore the gui?
Mod edit: Moved from Bug reports to Ask for help.
Re: Bug with <Alt> send commands
Breaking the script in the middle and doing the <Alt> function mnanually works.
Send !J or Send !j both works without the two lines in it.
The issue is not only with AHK, but also with VBA.
Send !J or Send !j both works without the two lines in it.
The issue is not only with AHK, but also with VBA.
Who is online
Users browsing this forum: AlFlo, Google [Bot] and 141 guests