Author Topic: While with Initget  (Read 6840 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: While with Initget
« Reply #15 on: August 31, 2012, 08:32:56 AM »
Another variation.
Code: [Select]
(defun c:test ( / lt )
       (while
           (cond
             ((initget "Line Pline Exit"))
             ((not (member (setq lt (getkword "\nLine or Pline? [Line/Polyline/Exit] <Exit>: "))'("Line" "Pline" "Exit"))) nil)
             (t
               (command (strcat "_." lt))
               (while (= 1 (logand 1 (getvar 'cmdactive)))
                 (command pause)
               ) t)
           )
       )
       (princ)
    )

edit: should have tested it  :-(
« Last Edit: August 31, 2012, 08:40:02 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: While with Initget
« Reply #16 on: August 31, 2012, 08:37:27 AM »
Good one there CAB. Though shouldn't it be
Code: [Select]
(= "Exit" ...perhaps? Else it issues an exit command.

Edit ... just say you edited it!  :kewl:


Perhaps
Code: [Select]
(member (...) '("Exit" nil))
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: While with Initget
« Reply #17 on: August 31, 2012, 08:40:53 AM »
That one is better, off to get my second cup  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: While with Initget
« Reply #18 on: August 31, 2012, 08:42:12 AM »
EDIT: Oops! I didn't read all the posts - it seems the OP now wants the 'Exit' to be default...

No  he wants LINE to be the default until he wants to exit and then he wants EXIT to be the default.  :evil:

 :-D

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: While with Initget
« Reply #19 on: August 31, 2012, 08:49:02 AM »
Actually I'm with him on this: The best interface is no interface.

Unless they can get some decent brainwave translator going I don't think it's possible though!
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: While with Initget
« Reply #20 on: August 31, 2012, 08:59:47 AM »
The typical scenario I use is ENTER goes to your common choice and ESCape is the exit key.  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

BlackBox

  • King Gator
  • Posts: 3770
Re: While with Initget
« Reply #21 on: August 31, 2012, 09:42:28 AM »
:lmao:
Yeah!!! I know! Funny as hell!  :pissed:

Anyhow, I hope I didn't confuse you too much RM  :lmao: .

Not at all, my friend... Just ribbing you; Happy Friday!  :angel:

Actually I'm with him on this: The best interface is no interface.

Unless they can get some decent brainwave translator going I don't think it's possible though!

BTW - Thanks for posting a link to this article; I've only skimmed it, but it looks pretty interesting.

Cheers! :beer:
« Last Edit: August 31, 2012, 10:39:01 AM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: While with Initget
« Reply #22 on: August 31, 2012, 10:36:58 AM »
Not at all, my friend... Just ribbing you; Happy Friday!  :angel:
Gathered as much  :laugh: . Cheers! I'm off for the weekend  :mrgreen:
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: While with Initget
« Reply #23 on: August 31, 2012, 11:38:31 AM »
Actually I'm with him on this: The best interface is no interface.

Unless they can get some decent brainwave translator going I don't think it's possible though!
An interesting read. Thanks  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MeasureUp

  • Bull Frog
  • Posts: 462
Re: While with Initget
« Reply #24 on: September 04, 2012, 12:33:44 AM »
Nice explanation.
Thanks for everyone's help.

chlh_jd

  • Guest
Re: While with Initget
« Reply #25 on: September 06, 2012, 09:20:29 AM »
Is this whether you prefer it  :-D
Code: [Select]
(defun c:test  (/ lt)
  ;; Edited from Alan's code
  (while
    (cond
      ((initget "Line Pline "))
      ((member (setq lt
      (getpoint
"\nLine or Pline? [Line/Polyline] <Select Point For Line / exit>: "))
       '("Line" "Pline"))
       (command (strcat "_." lt))
       (while (= 1 (logand 1 (getvar 'cmdactive)))
(command pause)
)
       t
       )
      ((vl-consp lt);_Select point , run default command "LINE"
       (command "_.Line")
       (command lt)
       (while (= 1 (logand 1 (getvar 'cmdactive)))
(command pause)
)
       t)
      )
    )
  (princ)
  )