OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Jim Short on May 25, 2015, 07:44:45 AM

Title: relaunch a command by pressing enter
Post by: Jim Short on May 25, 2015, 07:44:45 AM
Autocad can relaunch a command by pressing enter. How does one make this possible when the (command) was issued by a OpenDCL control?
Title: Re: relaunch a command by pressing enter
Post by: Fred Tomke on May 25, 2015, 12:51:05 PM
Hi, Jim, when you work with modeless forms, you can call events from controls which have EventInvoke set to 1 for AllowCommand. Then they are called as commands.
In one case I called it from a button when property EventInvoke is set to 0 (KeepFocus). In the event handler I set some blackboard variables and finally I call a command asynchronously. If the user hits enter again the latest settings are used from the blackboard.
Regards, Fred
Title: Re: relaunch a command by pressing enter
Post by: Jim Short on May 25, 2015, 02:50:36 PM
Still looking for way to relaunch an autocad command previously started by an opendcl event. That way pressing enter is faster than pressing a button again.
Commands run from the pull down menu will relaunch on pressing enter. Should this be possible in OpenDCL asynchronous events?
Jim
Title: Re: relaunch a command by pressing enter
Post by: roy_043 on May 26, 2015, 01:07:30 AM
Try using:
dcl-SendString
or:
vla-sendcommand

Code (autolisp) Select
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "_COMMAND ")
Note the space at the end of the string.
Title: Re: relaunch a command by pressing enter
Post by: Jim Short on May 29, 2015, 02:11:35 PM
This works well, Thanks very much!
Jim