TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 on October 04, 2015, 05:01:16 AM

Title: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on October 04, 2015, 05:01:16 AM
Hello to all,
I redefined some AutoCAD commands such as. the MOVE (SPOSTA in Italian).

In a normal situation (without third-party applications), pressing "S" followed by Enter, start the SPOSTA command (MOVE in English).
This happens even though the user before pressing Enter waits several seconds.

In my case, having redefined a few commands, it seems that the auto-complete feature gives priority to native AutoCAD commands and not those redefined.
For example, when the user types in the command bar "S" and wait too long before pressing ENTER, it starts the command "SALVAVEL" (QSAVE in English), instead of the command SPOSTA(MOVE in English).
This happens even if the PGP file is set up correctly.

This is very annoying !!  :-(

I found the following solutions, but none of those I like:
1. Set to code the variable INPUTSEARCHDELAY = 600: greatly improves the situation but does not fully resolve, also the code (setvar "INPUTSEARCHDELAY" 600) is not compatible with BricsCAD or with older versions of AutoCAD.

2. Disable from code the autocompletion, however this is not nice to the end user.  :cry:

Do you have any other ideas?
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 13, 2016, 11:56:00 PM
No suggestions here?
There is a variable to change the native AutoCAD commands priority than the LISP or redefined commands with lisp?
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 14, 2016, 03:27:15 AM
To simplify the explanation of the problem and allowing you to reproduce it attached a lisp files created for this purpose and a video.

I look forward  :roll:
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Randall Culp on December 14, 2016, 08:57:29 AM
What does function (c:redcommand) do??  It does not appear defined in the posted lisp function.
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: roy_043 on December 14, 2016, 09:28:11 AM
What does function (c:redcommand) do??  It does not appear defined in the posted lisp function.
Probably should be (c:RedefineCommand).

@Lupo76:
This problem seems like another good reason *not* to redefine commands...
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 14, 2016, 10:38:34 AM
What does function (c:redcommand) do??  It does not appear defined in the posted lisp function.
Probably should be (c:RedefineCommand).

Exact! I am attaching the correct lisp files

@Lupo76:
This problem seems like another good reason *not* to redefine commands...

mmmmm....I can not change the behavior of my application, it would be too complex.
The redefined commands work properly for years.
So I would like to find a solution to this problem.
In other words it would be enough to find a way to force the AutoCAD command bar to also consider the LISP functions as well as the native commands.
BricsCAD already has this behavior! :-)
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Randall Culp on December 14, 2016, 05:03:09 PM
I must be missing something because I really don't see any benefit in the posted function other than it forces select objects prior to moving and prohibits grip moving.  The same can be accomplished by setting PICKFIRST to 0.

If you want native function and some new function, simply name the list function something else.

Im confused  :crazy2:
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 15, 2016, 01:48:15 AM
I must be missing something because I really don't see any benefit in the posted function other than it forces select objects prior to moving and prohibits grip moving.  The same can be accomplished by setting PICKFIRST to 0.

If you want native function and some new function, simply name the list function something else.

Im confused  :crazy2:
The lisp that I put in here is just an example to describe the problem.
The full lisp are at least 200 lines of code ;-)
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: roy_043 on December 15, 2016, 03:33:57 AM
Does AutoCAD include the aliases in the .pgp file in the 'autocomplete list'?
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 15, 2016, 04:00:47 AM
Does AutoCAD include the aliases in the .pgp file in the 'autocomplete list'?

PGP file is correct, but I have not found any settings to include or exclude aliases in the 'autocomplete list'.
This setting exists? where?

PS. I think that if you try the lisp that I attached, you have the same problem.... or not?  :-o
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: roy_043 on December 15, 2016, 06:16:24 AM
I use BricsCAD so I do not experience this problem. :-D
BricsCAD's autocomplete includes command aliases, hence my suggestion.
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 15, 2016, 08:25:56 AM
I use BricsCAD so I do not experience this problem. :-D
BricsCAD's autocomplete includes command aliases, hence my suggestion.

I too use BricsCAD, but my application MUST be also compatible with AutoCAD.
No idea on how to solve?  :cry:  :cry:
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: ChrisCarlson on December 15, 2016, 08:33:09 AM
Why are you using a lisp routine to accomplish this? "ALIASEDIT" should more than accomplish what you are looking to do
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: roy_043 on December 15, 2016, 09:34:23 AM
@Master_Shake: I think you have misunderstood the OP's problem.
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: ChrisCarlson on December 15, 2016, 09:57:19 AM
Call me confused then

Code - Auto/Visual Lisp: [Select]
  1.   (defun c:sposta ()
  2.     (movenew)
  3.   )
  4. (defun movenew ()
  5.   (princ "\n############ Move_RedefinedCommand ############## !!!!!!!!!")
  6.   (setq obj (ssget))
  7.   (command "_.move" obj "" pause pause)
  8. )
  9.  
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: roy_043 on December 15, 2016, 10:08:17 AM
As the OP has already explained:
The Lisp code is a simplified version of the actual code.

The OP's problem in a nutshell:
How can you get AutoCAD to include redefined commands in its autocomplete feature.
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: ChrisCarlson on December 15, 2016, 10:38:19 AM
It must be tied to regional language packs then. Works as expected here on Vanilla AutoCAD 2017, by default "s" followed by entered defaults to "STRETCH" but typing "spos" beings up sposta.
Title: Re: Command redefined and INPUTSEARCHDELAY variable
Post by: Lupo76 on December 15, 2016, 11:35:09 AM
Call me confused then

Fantastic!! It works!!
I'm sorry but I did not understand your solution.
In PGP files I've always entered the abbreviation and not the entire command!

S,     *SPOSTA not work
SPOSTA,      *MOVE      works :-D


Thank you!