Setting last command for right click repeat

Started by hmspe, December 11, 2017, 07:28:07 AM

Previous topic - Next topic

hmspe

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.

owenwengerd

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.

hmspe

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....


roy_043

I think Owen is referring to dcl-SendString or vla-sendcommand.