OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: hmspe on December 11, 2017, 07:28:07 AM

Title: Setting last command for right click repeat
Post by: hmspe on December 11, 2017, 07:28:07 AM
I have a modeless form that I want to use as a replacement for a toolbar flyout.  The form is called from a Bricscad toolbar button.  OnClick each graphic button on the form closes the form then calls a lisp function to insert a specific part. 

What I'd like is after using the form to insert a part is for right click to re-call the part insertion function directly so I can do multiple insertions of the part.  What happens is that right click calls the form again.

Is there a way configure the code so that "Repeat Last Command" repeats the selected insertion function rather than calling the form again?

Thanks.
Title: Re: Setting last command for right click repeat
Post by: owenwengerd on December 11, 2017, 09:52:50 AM
Do you mean that a right-click executes the toolbar button menu macro? If so, then you need to change your OnClick event to send a command instead of calling a lisp function.
Title: Re: Setting last command for right click repeat
Post by: hmspe on December 12, 2017, 05:51:27 AM
Thanks, Owen. 

It looks like changing every insertion c:defun to a command may be a bit of a challenge since vlax-add-cmd does not like 'command' calls.  Writing code to replace " (command "_insert" "E_2STRIP" "PS" 96 pause 96 96 pause)" that keeps all the functionality but avoids 'command' and 'vl-cmdf' does not appear to be trivial.

Or maybe I'm missing an easier solution....

Title: Re: Setting last command for right click repeat
Post by: roy_043 on December 12, 2017, 07:19:30 AM
I think Owen is referring to dcl-SendString or vla-sendcommand.
Title: Re: Setting last command for right click repeat
Post by: hmspe on December 12, 2017, 07:58:18 AM
Thanks.