shortcut to copy face

Discussion in 'AutoCAD' started by iwafb, Dec 8, 2004.

  1. iwafb

    iwafb Guest

    Hi all,

    I have a current shortcut in the system to copy the face of a solid:

    (Defun c:CF () (command "solidedit" "face" "copy"))

    The annoying thing is that once you copied the face, you have to press enter twice to exit the command. I have tried to use pauses and (command "") at the end of the definition, but solidedit does not seem to reenter the lisp until I have exited the command. Any ideas on how to overcome this?

    Thanks in advance
    Dart
     
    iwafb, Dec 8, 2004
    #1
  2. iwafb

    OLD-CADaver Guest

    instead of (command "") use (command)

    (defun c:cf () (command "solidedit" "face" "copy" pause pause pause pause (command)(command)))
     
    OLD-CADaver, Dec 8, 2004
    #2
  3. iwafb

    LUCAS Guest

    (defun C:CF ()
    (setvar "cmdecho" 1)
    (command "solidedit"
    "face"
    "copy"
    )
    (while (= 1 (getvar "cmdactive"))
    (command PAUSE)
    )
    (princ)
    )
    (command)(command)))
     
    LUCAS, Dec 8, 2004
    #3
  4. iwafb

    iwafb Guest

    Thanks to you both. I was in fact going to reply to OC to ask him how to allow for a variable number of mouse picks. Yours does this, but it does not exit the program (I still have to press enter twice to exit. I tried something similar, but cmdactive is > 1 until I exit the program which defits the purpose. Any ideas?

    (defun c:cf () (command "solidedit" "face" "copy" (while (> (getvar "cmdactive") 0) (command pause)) (command)(command)))


    Thanks
    Dart
     
    iwafb, Dec 8, 2004
    #4
  5. iwafb

    OLD-CADaver Guest

    I had a little trouble with cmdactive and SOLIDEDIT tripping over themselves, so I posted the other.
     
    OLD-CADaver, Dec 8, 2004
    #5
  6. iwafb

    mataeux Guest

    you might want to try:
    (while (wcmatch(strcase(getvar "lastprompt")) "*EXIT*" ) (command pause) )
    then (command) (command)

    allow for a variable number of mouse picks. Yours does this, but it does not
    exit the program (I still have to press enter twice to exit. I tried
    something similar, but cmdactive is > 1 until I exit the program which
    defits the purpose. Any ideas?
    "cmdactive") 0) (command pause)) (command)(command)))
     
    mataeux, Dec 8, 2004
    #6
  7. iwafb

    mataeux Guest

    i meant
    (while (NOT (wcmatch(strcase(getvar "lastprompt")) "*EXIT*" )) (command
    pause) )
     
    mataeux, Dec 8, 2004
    #7
  8. iwafb

    iwafb Guest

    Good work!

    Thanks
    Dart
     
    iwafb, Dec 12, 2004
    #8
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.