(command "qleader") does not offer settings on command line

(command "qleader") does not offer settings on command line

JamesMaeding
Advisor Advisor
1,685 Views
13 Replies
Message 1 of 14

(command "qleader") does not offer settings on command line

JamesMaeding
Advisor
Advisor

How do I get this to show, like when you type qleader straight on command line:

Specify first leader point, or [Settings] <Settings>:

 

I simply want to make a key-in with lisp like:

(DEFUN C:Q    () (command "qleader"))

 

but that gives no settings option on command line....


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Accepted solutions (1)
1,686 Views
13 Replies
Replies (13)
Message 2 of 14

paullimapa
Mentor
Mentor

Works for me when I run the same sequence.  What happens if you include the Settings input in the code, would it work?

(DEFUN C:Q    () (command "qleader""settings"))

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 14

JamesMaeding
Advisor
Advisor

well, S does give the settings but the users cannot see that as an option.

I want the key-in Q to do exactly the same thing as QLEADER, and I will not be using the pgp file for this.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 4 of 14

Ranjit_Singh
Advisor
Advisor
Accepted solution

Maybe check the cmdecho and nomutt variables?

Message 5 of 14

lando7189
Advocate
Advocate

Refer to R Robert Bell's response here -- there is a QLSET.lsp file that should get you what you need.

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setvars-for-qleader-variables/m-p/16...

0 Likes
Message 6 of 14

JamesMaeding
Advisor
Advisor

@lando7189

Thanks, but I saw that and is not related to what I am asking.

Maybe re-read my original post.

 

I also tried cmdecho, nomutt....no go.

thx

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 7 of 14

lando7189
Advocate
Advocate

Sorry about the misread... try this:

 

(defun C:Q ( / q_err old_err pt nomutt cmdecho)
  (if (setq pt (getpoint "\nSpecify first leader point... "))
    (progn

	  (defun q_err (s)
	    (if (/= s "Function cancelled")
	      (progn
	       (princ (strcat "\nError: " s))
	      )
	    )
	    (setq *error* old_err)
	    (setvar "NOMUTT"  nomutt)
        (setvar "CMDECHO" cmdecho)
	  )
      
      (setq old_err *error* *error* q_err)
      (setq nomutt  (getvar "NOMUTT"))
      (setq cmdecho (getvar "CMDECHO"))
      (setvar "NOMUTT"  1)
      (setvar "CMDECHO" 0)
      (command "QLEADER" pt)
      (setvar "NOMUTT"  nomutt)
      (setvar "CMDECHO" cmdecho)
      (setq *error* old_err)
    )
  )
  (princ)
)
0 Likes
Message 8 of 14

Ranjit_Singh
Advisor
Advisor

OK. Try using command-s instead of command.

(DEFUN C:Q () (command-s "qleader"))

command-s_vs_command.gif

 

Message 9 of 14

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

...

I want the key-in Q to do exactly the same thing as QLEADER, and I will not be using the pgp file for this.


Why? LISP might give you a different command or you might lose some functionality (eg. preview).


Try it with (prince) at the end... nil might cause a trouble...

 

(DEFUN C:Q    () (command "qleader") (princ))

0 Likes
Message 10 of 14

lando7189
Advocate
Advocate

Ahh... i have never used command-s yet myself (i try to avoid command line usage in most of my own stuff).  That actually avoids having to use an error catcher my lisp command (it is your solution, but using a 'getpoint' to avoid the 'blank' command line)

 

(defun C:Q ( / pt)
  (if (setq pt (getpoint "\nSpecify first leader point... "))
    (command-s "QLEADER" pt)
  )
  (princ)
)

 

 

0 Likes
Message 11 of 14

JamesMaeding
Advisor
Advisor

Well this is definitely entertaining, but I don't think anyone is testing their ideas, none work.

I had already tried all of them anyway, I've done lisp forever and typically its some initget needed for calling from lisp (command... statement.

 

There is some devilry going on with qleader that I have not seen before.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 12 of 14

Ranjit_Singh
Advisor
Advisor

........but I don't think anyone is testing their ideas, none work........


Post #8 clearly shows how it works on my system. Even testing @ВeekeeCZ's suggestion worked at my end. See below.

princ_option_qleader.gif

If both of those options don't work on your system then we can safely conclude that the problem is in your system, and not with qleader. I believe even @lando7189 confirmed that one of those options worked on his systems. Maybe test on a different workstation. Good luck.

Message 13 of 14

Kent1Cooper
Consultant
Consultant

@Ranjit_Singh wrote:

OK. Try using command-s instead of command.  ....


That "shouldn't" work, because [from 2018 Help] "The command that is being executed must be started and completed in the same command-s function."

 

If, as it appears from your video clip, it will  in fact leave you in the command if you don't supply everything to complete it, I don't see any advantage over just plain (command).  That worked for me, offering the Settings option the OP is looking for, both on its own and when defined into a command name with (defun).  So if it doesn't for them, there must be something else going on, as suggested in Post 12.

Kent Cooper, AIA
Message 14 of 14

JamesMaeding
Advisor
Advisor

I see, I was turing on cmdecho , then right off in a little function I use to print the command desc to the command line, duh.

Good call, CMDECHO to 1 is the answer.

 

We see yet again why the first letter of Lisp stands for lost 🙂


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes