Dumb question

Discussion in 'AutoCAD' started by Jamie Duncan \(remove lock to reply\), Apr 9, 2004.

  1. How do you handle command line prompting/looping and exiting for selection
    sets?

    ssget doesn't allow a prompt. Which way do you do it for selection sets
    that contain more than one item?


    Jamie Duncan

    Consulting - If you're not part of the solution, there's good money in
    prolonging the problem.
     
    Jamie Duncan \(remove lock to reply\), Apr 9, 2004
    #1
  2. Jamie Duncan \(remove lock to reply\)

    Mark Propst Guest

    don't know what you mean by looping and exiting
    but a little routine I use for getting a selection set is:
    (defun adcf-GetSet ( prmpt / selset)
    (or(setq selset (ssget "I"))
    (progn
    (if prmpt(prompt prmpt))
    (setq selset (ssget))
    );prong
    )
    selset
    )

    I usually select items first then issue command(pickfirst =1) so I wrote
    this to work the way I'm used to, if theres' an existing set selected, it
    uses that, else if theres' a prompt string passed in, it issues that prompt
    then calls ssget.

    then if you want to filter for items there's this one:
    ;;; if an implied set exists it is filtered according to filter list and
    returned
    ;;; if not, if a prompt is supplied, the prompt is issued then ssget gets
    filtered set
    ;;; Get set filtered with prompt
    (defun adcf-GetSetFp (filterList prmpt / rtnset)
    (or
    (setq rtnset(ssget "i" filterList))
    (progn
    (if prmpt(prompt prmpt))
    (setq rtnset(ssget filterList))
    );progn
    )
    rtnset
    )

    eg: (setq blkRefSet(adcf-GetSetFp (list(cons 0 "INSERT"))"\nSelect block
    inserts to mess with... "))
    or
    (setq blkRefSet(adcf-GetSetFp (list(cons 0 "INSERT")(cons 2
    "BlockName"))"\nSelect blockName inserts to mess with... "))
    or simply
    (setq blkRefSet(adcf-GetSetFp (list(cons 2 "BlockName"))"\nSelect blockName
    inserts to mess with... "))

    that's what the prompt function is for, but it means you have to have more
    than one line showing in your command line window

    Which way do you do it for selection sets
    no idea what you mean there, many selection sets have more than one item...

    hth
    Mark
     
    Mark Propst, Apr 9, 2004
    #2
  3. Jamie Duncan \(remove lock to reply\)

    F. Gump Guest

    ssget doesn't allow a prompt. Which way do you do it for selection sets
    Maybe I'm not understanding you. When I issue a (ssget) I get to pick as
    many objects as I want.
    --------------
    Command: (ssget)
    Select objects: 1 found
    Select objects: 1 found, 2 total
    Select objects: 1 found, 3 total
    Select objects: Specify opposite corner: 2 found, 5 total
    Select objects: Specify opposite corner: 1 found, 6 total
    Select objects: Specify opposite corner: 1 found, 7 total
    Select objects: w
    Specify first corner: Specify opposite corner: 3 found (3 duplicate), 7
    total
    Select objects:
    <Selection set: 3>
     
    F. Gump, Apr 9, 2004
    #3
  4. Jamie Duncan \(remove lock to reply\)

    Barr Guest

    And if you wanna get specific, you can preface it with a princ or
    prompt.
    (princ "\nPlease pick some daisies... don't be greedy, and ONLY the
    daisies: ")
    (setq flowers (ssget))
     
    Barr, Apr 9, 2004
    #4
  5. Jamie Duncan \(remove lock to reply\)

    Jamie Duncan Guest

    Thanks for the replies, it revolves around something where the selection set
    is in the start portion of the while
    i.e. instead of:

    (while (not (setq flowers(ssget....

    (while looper
    (prompt "\nSelect the daisies or the lupens or <Exit>: ")
    (setq flowers (ssget

    now say the user picks some flowers here and there, and then says, hmmm
    exactly which flowers was I supposed to pick, but now the prompt says
    'Select Objects...'

    I like the functionality of getpoint for example where using initget you can
    control quite a few options. I guess it's just not possible to have near
    that kind of functionality with ".select" or ssget or whatever you use to
    select objects

    I would love to be able to set/reset the ssget prompt - but can't see a way
    of doing this.

    Just me wanting a nicer interface than just 'Select Objects...'

    Just some musings and wishfulness I guess...

    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 9, 2004
    #5
  6. Jamie Duncan \(remove lock to reply\)

    Barr Guest

    Sheesh Dagny, they're "lupines".

     
    Barr, Apr 9, 2004
    #6
  7. Jamie Duncan \(remove lock to reply\)

    Jamie Duncan Guest

    hah! no wonder (ssget "X" '((0 . "LUPENS"))) wasn't working!

    <g>

    hmm, didn't even remark on the wishful/wistfulness play...

    I'm running downstairs now to begin a spring cleaning....have a nice Easter
    DB

    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 9, 2004
    #7
  8. Jamie Duncan \(remove lock to reply\)

    Barr Guest

    Hmmm... how exactly is that a play on words? You mean like it would be
    wrong to say 'that was just wistful thinking'? I guess I'm not privy
    to Canadianglishisms. Amurricans say it both ways, I think.
    nice Easter

    Easter... Ahhh the good ol days, hiding candy for the kids. Then as
    they got older I spent hours and hours making up clues for an indoor
    treasure hunt. THIS year, my younger son is on a special diet trying
    to conquer his acne. Currently he's off most everything that might be
    considered easterlike.

    So I think it'll just be a day like any other.
    Maybe I'll do the treasure hunt with money at the other end.
    -doug
     
    Barr, Apr 9, 2004
    #8
  9. Jamie Duncan \(remove lock to reply\)

    Jamie Duncan Guest

    wistfulness+wishful = wishfulness



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 9, 2004
    #9
  10. Jamie Duncan \(remove lock to reply\)

    Gary J. Orr Guest

    Let's step outside of the box...
    You want a selection set, so you're using ssget,
    What about ssadd and entsel?

    (setq selset nil)
    (setq saywhat "\nSelect the Flowers of your choice or <exit>: ")
    (setq enty (entsel saywhat))
    (While enty
    (if (= " " enty) (setq enty nil))
    (if selset
    (setq selset (ssadd (car enty) selset))
    (setq selset (ssadd (car enty)))
    )
    )
    (redraw (car enty) 3);highlight it
    (setq enty (entsel saywhat))
    )

    (command "regen");unhighlight

    --
    Gary J. Orr
    CADD Administrator
    (218) 279-2421


    LHB, Inc
    21 West Superior Street, Suite 500
    Duluth, Mn 55802
    (218) 727-8446
    www.LHBcorp.com
     
    Gary J. Orr, Apr 9, 2004
    #10
  11. Jamie Duncan \(remove lock to reply\)

    Jamie Duncan Guest

    Thanks Gary

    I knew I could go along those lines but enstel doesn't allow all of the nice
    things that ssget does (like windowing/crossing etc)


    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 10, 2004
    #11
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.