How to allow using menu while in a loop w/ (grread)?

Discussion in 'AutoCAD' started by ETenenbaum, Oct 12, 2004.

  1. ETenenbaum

    ETenenbaum Guest

    How to execute a command picked from a menu while in a loop with (grread)? In the following example, if a menu command was picked instead of a screen point, (ssget) is executed prompting to “Select objects:â€, but also allowing to pick and execute a menu command, and then, after pressing ENTER, allowing to go back to the loop. How to allow executing a menu command (e.g. View->Zoom->Previous) without using (ssget), while in loop, please?
    Sincerely,
    Eugene Tenenbaum

    (defun c:grr (/ ob1 va pt obj)
    (while (not obj)
    (prompt "\nPick point: ")
    (setq va (car (setq ob1 (grread nil))) pt (cadr ob1) )
    (cond
    ( (= va 3) (setq obj 1) )
    ( (= va 11) (prompt "\nPick Icon: ") (ssget) )
    );end cond
    );end while
    );end defun
     
    ETenenbaum, Oct 12, 2004
    #1
  2. As I recall, this is complicated and not doable so far.
    I think it had to do with the complication of figuring out what menu the pick came from.
    Look for threads by John Uhden, I think he took an incredible stab at the problem a while back and gave up.

    ETenenbaum <>
    |>How to execute a command picked from a menu while in a loop with (grread)? In the following example, if a menu command was picked instead of a screen point, (ssget) is executed prompting to “Select objects:”, but also allowing to pick and execute a menu command, and then, after pressing ENTER, allowing to go back to the loop. How to allow executing a menu command (e.g. View->Zoom->Previous) without using (ssget), while in loop, please?
    |>Sincerely,
    |>Eugene Tenenbaum
    |>
    |>(defun c:grr (/ ob1 va pt obj)
    |>(while (not obj)
    |>(prompt "\nPick point: ")
    |>(setq va (car (setq ob1 (grread nil))) pt (cadr ob1) )
    |>(cond
    |>( (= va 3) (setq obj 1) )
    |>( (= va 11) (prompt "\nPick Icon: ") (ssget) )
    |>);end cond
    |>);end while
    |>);end defun

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Oct 12, 2004
    #2
  3. ETenenbaum

    ETenenbaum Guest

    James,
    So how it is done within SSGET (the SELECT command) seemingly possible?
    -Eugene
     
    ETenenbaum, Oct 12, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.