Unending command

Discussion in 'AutoCAD' started by charlieb, Jan 13, 2005.

  1. charlieb

    charlieb Guest

    I have written a lisp routine and loaded it on several machines in my office. On one machine the routine repeats itself continually until canceled. This does not happen on the other machines, what system variable needs to be changed to correct this situation.

    Charlie Bauer
    CAD Resource Group Manager
    InnerWireless, Inc.
     
    charlieb, Jan 13, 2005
    #1
  2. There's no system variable to control this. If the
    script is repeating itself, there can be several
    causes, one is that it's being started via a menu
    macro that uses the 'MULTIPLE' option. There's
    others, but I'm not going to list them.

    First, how are you starting the LISP? Is it defined
    as a command (e.g., using defun C:XXXX) ? Is
    it started via a menu macro? If so, does it also
    do this when you start it using the keyboard?
     
    Tony Tanzillo, Jan 13, 2005
    #2
  3. My question would be, "What version(s) of AutoCAD are you using?" I have
    lots of lisp macro routine menu items that start with *^C^C to make them
    repeat automatically. They all worked fine until we moved to AutoCAD 2000.
    Then some of them still repeated, and some didn't any more. It seems that
    routines that save a location for later re-use are the ones that no longer
    repeat, but I'm not sure that's the absolute defining difference.
    If your routine starts with *^C^C, and not every machine has the same
    version, that bug could be the reason it repeats on some machines (that is,
    in some versions of AutoCAD) and not others.
     
    Kent Cooper, AIA, Jan 13, 2005
    #3
  4. charlieb

    charlieb Guest

    Here is a copy of one of the routines
    (Defun C:CABLE12COAX ()
    (SETQ OLDCMDECHO (GETVAR "CMDECHO"))
    (SETQ OLDLAYER (GETVAR "CLAYER"))
    (SETQ OLDATTREQ (GETVAR "ATTREQ"))
    (SETQ OLDATTMODE (GETVAR "ATTMODE"))
    (SETQ OLDOSMODE (GETVAR "OSMODE"))
    (SETQ OLDORTHO (GETVAR "ORTHOMODE"))
    (SETQ OLDATTDIA (GETVAR "ATTDIA"))
    (SETQ OLDDIMSTYLE (GETVAR "DIMSTYLE"))

    (SETVAR "CMDECHO" 0)
    (SETVAR "ATTREQ" 1)
    (SETVAR "ATTMODE" 1)
    (SETVAR "ATTDIA" 1)
    (SETVAR "OSMODE" 512)
    (SETVAR "CLAYER" "001_Dim-Text")

    (COMMAND "DIMSTYLE" "" "C-001")


    (SETQ pt1 (GETPOINT "\n Pick start of leader."))
    (SETVAR "OSMODE" 0)
    (SETQ pt2 (GETPOINT "\n Pick endpoint of Leader"))
    (COMMAND "QLEADER" pt1 pt2 "" "" n)

    (SETQ rad (ANGLE pt1 pt2))

    (setq ang1 (atof (angtos rad 0 2)))

    (COND
    ((or (< ang1 90)(> ang1 270))
    (COMMAND "INSERT" "TxC12_Coax-L" pt2 (GETVAR "DIMSCALE") "" ""))
    ((>= ang1 90)
    (COMMAND "INSERT" "TxC12_Coax-R" pt2 (GETVAR "DIMSCALE") "" ""))
    )

    (SETVAR "CLAYER" OLDLAYER)
    (SETVAR "ATTREQ" OLDATTREQ)
    (SETVAR "ATTMODE" OLDATTMODE)
    (SETVAR "ORTHOMODE" OLDORTHO)
    (SETVAR "OSMODE" OLDOSMODE)
    (SETVAR "CMDECHO" OLDCMDECHO)
    (SETVAR "ATTDIA" OLDATTDIA)
    (PRINC)
    )
    and here is the macro I use to launch the code
    (load "Cable12-Coax") cable12coax

    I am using 2005 vanilla and I run the routines from the tool palette. When I run the routine from the command line it does not repeat itself.

    Charlie
     
    charlieb, Jan 27, 2005
    #4
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.