lsp help - secret charater

Discussion in 'AutoCAD' started by Jamie Richardson, Jun 22, 2004.

  1. I have a program that starts out asking the user for a point.

    (setq PT1 (getpoint "\nPICK FIRST CONNECTION POINT:"))

    At this spot I would like the user to be able to enter a secret
    character. If this character is entered it will end the lsp routine with
    no other action and start a different one.

    Example:
    I have a beam program that puts the beam and text on plan after picking
    2 points. Every once in a while a moment connection is required. This is
    where I would like the user to be able to type M This would then toggle
    to a dcl box where they can check boxes for left, right, or both end
    moment connections, then proceed to ask for point 1 and 2 and put the
    beam on plan with the symbol.

    Any help in the right direction would be appreciated.
     
    Jamie Richardson, Jun 22, 2004
    #1
  2. Jamie Richardson

    Paul Turvill Guest

    The (initget) function is what you're looking for. (initget 128) will allow
    the following (getxxx ...) function to accept arbitrary input. Then just
    check the input to see if the arbitrary input is a point or the secret
    character, and use an (if ...) or (cond ...) function to branch accordingly.
    ___
     
    Paul Turvill, Jun 22, 2004
    #2
  3. Jamie Richardson

    Jim Claypool Guest

    (initget "M") might work better because it will not accept anything except a
    point or M (or m)
     
    Jim Claypool, Jun 22, 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.