Command Forward & Backward

Discussion in 'AutoCAD' started by JamieLandmark, Sep 10, 2004.

  1. What are the lisp keys to many AutoCAD commands being able to used two ways? E.g., the move command.

    You can select the object, and then start the move command; or you can start the move command, and then select the object.

    I'd like to place this functionality into a routine I'm writing with the copy command.

    Can someone help, or direct me to a web site or article that answers this question?

    Thanks,

    Jamie
     
    JamieLandmark, Sep 10, 2004
    #1
  2. JamieLandmark

    Rad_Cadder Guest

    Autocad's "PICKFIRST" Variable controls whether you have to select and object before envoking the command.
    Pickfirst = 1 allows you to select object then move
    Pickfirst = 0 you must envoke command first

    Hope this helps!
     
    Rad_Cadder, Sep 10, 2004
    #2
  3. JamieLandmark

    Jeff Mishler Guest

    (or (setq ss (ssget "I"))
    (setq ss (ssget))
    )
     
    Jeff Mishler, Sep 10, 2004
    #3
  4. Thanks for the replies.

    Rad_Cadder, thanks for the info on Pickfirst. I still need to find out if it applies here (if it needs to be added within my code).

    Jeff, I tried adding your lines into my code and am still facing some problems. As it is, there isn't a pause when I enact the command first. Do I simply need to use the pause function, or is my problem elsewhere? Do I need to use the if function?

    I'd appreciate any help/direction. I've attached my attempted code.

    Thanks,

    Jamie

    ;Routine to copy an object from 0,0 to 0,0,
    ;and then to erase the previous object.
    ;
    ;Jamie
    ;9-10-04
    ;
    (defun c:coperp ()
    (or
    (setq x (ssget "L"))
    (setq x (ssget))
    )
    (command "copy" x "" "0,0" "0,0")
    (command "erase" "p" "")
    (princ)
    )
     
    JamieLandmark, Sep 12, 2004
    #4
  5. JamieLandmark

    Paul Turvill Guest

    (ssget "L") will select the last object drawn, so there's no reason for the
    routine to pause unless you're in an empty drawing -- in which case there's
    nothing to copy anyway. If you use (ssget "I") (letter 'eye'), as in C.
    Witt's example, then it will use a highlighted selection set if pickfirst =
    1 and there *are* objects preselected, or it will pause for input if not.
    ___
     
    Paul Turvill, Sep 12, 2004
    #5
  6. Thanks, Paul.

    I guess I misread Jeff's post. Should've copied and pasted.

    I'll try the letter "I" (eye), and hope for improved results.

    Thanks for replying,

    Jamie
     
    JamieLandmark, Sep 12, 2004
    #6
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.