TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: aaa120 on November 27, 2011, 12:44:11 AM

Title: How to type CAD command without spacebar?
Post by: aaa120 on November 27, 2011, 12:44:11 AM
when I type "L"(line command ) ,CAD will type spacebar after "L"
How to make "L" instead of "L+spacebar"?
Title: Re: How to type CAD command without spacebar?
Post by: aaa120 on November 27, 2011, 12:47:16 AM
I hate to press spacebar everytime after I press "L" key 
Title: Re: How to type CAD command without spacebar?
Post by: Kerry on November 27, 2011, 01:09:11 AM

Your analysis of the process is incorrect.

When you type 'L' at the command line AutoCAD does not know what to do untill you press either ENTER or SPACEBAR ... at that time AutoCAD reads the complete text entered ( in this case a single 'L" ) and interprets the text.

Imagine if you wanted to run the command L A Y E R ... without the ENTER or SPACEBAR AutoCAD would not be able ro run this command ...


The closest I can imagine to your wish is a toolbar button. A single click will run the macro behind the button.


Regards

Title: Re: How to type CAD command without spacebar?
Post by: jaydee on November 27, 2011, 01:39:06 AM
Something like this might be possible using grread.
If you run this IncAtt lisp from pBe and and user input option part is do without enter/space bar.

Quote from pBe and the link http://www.theswamp.org/index.php?topic=39739.msg450543#msg450543 (http://www.theswamp.org/index.php?topic=39739.msg450543#msg450543)
Have time to write one:

Code: [Select]
(defun c:IncAtt ( / *IntGet1 AddTonth Mr parse gr g1 g2 nVal att)
(vl-load-com) 
(defun *IntGet1 (fn msg)
   (initget 1)
   (setq val ((eval fn) msg))
   (if (eq val "")
   (progn
     (princ "Null Input Try again")
   (*IntGet1 fn msg)))
  val     
  )
(defun AddTonth (str num val / stl orgstr attEnt)
  (setq str (strcat  "©" str))
  (if (and (setq stl (parse (reverse (vl-string->list str))))
    (setq orgstr  (nth (1- num) stl)))
    (substr
    (vl-string-subst (strcat (substr orgstr 1 1)(itoa
( + (atoi (substr orgstr 2)) val)))
  orgstr str) 2)
        )
  )
(defun parse (lst / a b c pr d)
  (while (setq a (car lst))
    (setq b (cdr lst))
    (if (and
      (>= a 48)
      (<= a 57))
      (setq c (cons a c))
(if c  (setq d (append  (list (cons (car lst) c)) d ) c nil))
  )
    (setq lst b))
  (mapcar 'vl-list->string d)
  )
(setq MR nil)
  (while (null Mr)
  (princ (strcat "\nSelected Tag: "
(if (or (null att)
(/= (cdr (assoc 0 (entget att))) "ATTRIB"))
"None" (cdr (assoc 2 (entget att))))
"\tInteger position: "
(itoa (if (null pst) (setq pst 1) pst))
"\tIncrement Value:  "
(itoa (if (null val) (setq val 1) val))
"\nSelect texts or [Position/Value]<Enter when done:\n"
)
)
(setq gr (grread nil 14 2)
                  g1 (car  gr)
                  g2 (cadr gr)
            )
(cond
                   ((and (= 2 g1)
(member g2 '(118 86 )))
    (setq val (*IntGet1 'Getint "\nEnter Increment Value: ")))
   ((and (= 2 g1)
(member g2 '(112 80 )))
    (setq pst (*IntGet1 'Getint "\nEnter Integer Position: ")))
   ((= 3 g1)
        (if (and (setq att (car (nentselp g2)))
(eq (cdr (assoc 0 (entget att))) "ATTRIB"))
(vla-put-TextString (vlax-ename->vla-object att)
(if (setq nVal (AddTonth (cdr (assoc 1 (entget att))) pst val))
  nVal (cdr (assoc 1 (entget att)))))
  (princ "\nNone Selected and/or No Integer Found\n"))
    )
   ((and (= 2 g1)
(member g2 '(32 13 )))(setq Mr T)
    )
)
)
(princ)
)

Hope this helps
Title: Re: How to type CAD command without spacebar?
Post by: Tharwat on November 27, 2011, 02:06:57 AM
Hi.

You can adjust your mouse ( right click button ) from the command option -> right click customization which would allow you to use mouse instead of pressing Enter or SpaceBar  .

See the link for more help ..

http://docs.autodesk.com/ACD/2011/ENU/filesACR/WS1a9193826455f5ffa23ce210c4a30acaf-4968.htm (http://docs.autodesk.com/ACD/2011/ENU/filesACR/WS1a9193826455f5ffa23ce210c4a30acaf-4968.htm)

Title: Re: How to type CAD command without spacebar?
Post by: Kerry on November 27, 2011, 02:10:10 AM
Quote from: http://c2.com/cgi/wiki?PurposeOfProgramming
I have a theory that software engineering is one of the few industries that are concerned with turning money into time - by spending money we (supposedly) save other people time by automating processes they'd otherwise have to do by some other means that would take them longer. (Concorde flight crews are another.)

The trouble with the theory is that the processes we automate are far too often unnecessary anyway...



Regards
Title: Re: How to type CAD command without spacebar?
Post by: Kerry on November 27, 2011, 03:40:22 AM


I hate to press spacebar everytime after I press "L" key 

I this a preference or is there another reason you hate SPACEBAR ?

Did you know that if the last command was LINE you can press ENTER or SPACEBAR to re-run the last command .. without pressing 'L' again ?

Regards
Title: Re: How to type CAD command without spacebar?
Post by: qjchen on November 27, 2011, 05:17:59 AM
when I type "L"(line command ) ,CAD will type spacebar after "L"
How to make "L" instead of "L+spacebar"?

You can use extra tools to do this.
Like Autohook, or AutoHotkey.
Title: Re: How to type CAD command without spacebar?
Post by: aaa120 on November 27, 2011, 06:33:57 AM
when I type "L"(line command ) ,CAD will type spacebar after "L"
How to make "L" instead of "L+spacebar"?

You can use extra tools to do this.
Like Autohook, or AutoHotkey.

哈哈哈  你是中国人呀
Title: Re: How to type CAD command without spacebar?
Post by: Ketxu on November 28, 2011, 02:37:09 AM
@aaa120 : how autoCAD can understand what you want, L or Li Le La .... if you don't wanna give him your decision ? I think you need 0.1s to press Space by left thumb only, don't be too lazzy  :ugly:
Title: Re: How to type CAD command without spacebar?
Post by: Chris on November 28, 2011, 08:25:33 AM
If you really dont want to press spacebar, in 2012, with dynamic input, you can type L, then wait a little bit, and the command complete will pop up, and you can click on Line. but it is much faster to hit L+enter or L+spacebar