+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Super Member chelsea1307's Avatar
    Computer Details
    chelsea1307's Computer Details
    Operating System:
    windows xp
    Using
    AutoCAD 2011
    Join Date
    Sep 2008
    Location
    Sacramento, Ca USA
    Posts
    1,109

    Default Help fixing lisp

    Registered forum members do not see this ad.

    The two codes below have been used by my office since before i started working here. They've worked fine in the past and today they decided to stop. I get this error for the first one:
    Command: sa
    Pick insertion point:
    Angle?:
    ; error: An error has occurred inside the *error* functiontoo many arguments
    ; error: An error has occurred inside the *error* functiontoo many arguments
    Unknown command "SA". Press F1 for help.
    and this error for the second one:
    Command: 4SA
    NPICK POINT; error: An error has occurred inside the *error* functiontoo many
    arguments
    ; error: An error has occurred inside the *error* functiontoo many arguments
    Unknown command "SA". Press F1 for help.
    Unknown command "@15,0". Press F1 for help.
    48.000000
    LISP command is not available.
    48.000000
    (yes they are both loaded i double and triple checked that)
    Code:
     inserts air direction arrow (supply)
    (defun c:sa ()
    (setq ortho (getvar "orthomode"))
    (setq scl (getvar "dimscale" ))
    (setvar "orthomode" 1)
    (setq pnt (getpoint "\nPick insertion point:" ))
    (setq a (getangle "\nAngle?:" pnt ))(terpri) 
    (setq ang ( * a 57.3))
    (command "layer" "set" "txt" "")
    (command "insert" "sa" pnt scl scl ang) 
    )
    Code:
     inserts 4 way air direction arrows for diffuser
    (defun c:4sa ()
    (SETVAR "OSMODE" 64)
    (SETQ INS (GETPOINT "\NPICK POINT"))
    (COMMAND "ID" INS)
    (setvar "clayer" "txt")
    (setq scl (getvar "dimscale" ))
    (command "insert" "sa" "@15,0" scl scl 0)
    (COMMAND "ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
    (SETVAR "OSMODE" 0)
    )
    "The problem is stupidity. I am not saying there should be capital punishment for stupidity, but, why don't we just take the safety labels off of everything and let the problem solve itself? "

  2. #2
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    Quote Originally Posted by chelsea1307 View Post
    The two codes below have been used by my office since before i started working here. They've worked fine in the past and today they decided to stop. I get this error for the first one:
    Command: sa
    Pick insertion point:
    Angle?:
    ; error: An error has occurred inside the *error* functiontoo many arguments
    ; error: An error has occurred inside the *error* functiontoo many arguments
    Unknown command "SA". Press F1 for help.
    and this error for the second one:
    Command: 4SA
    NPICK POINT; error: An error has occurred inside the *error* functiontoo many
    arguments
    ; error: An error has occurred inside the *error* functiontoo many arguments
    Unknown command "SA". Press F1 for help.
    Unknown command "@15,0". Press F1 for help.
    48.000000
    LISP command is not available.
    48.000000
    (yes they are both loaded i double and triple checked that)
    Code:
     inserts air direction arrow (supply)
    (defun c:sa ()
    (setq ortho (getvar "orthomode"))
    (setq scl (getvar "dimscale" ))
    (setvar "orthomode" 1)
    (setq pnt (getpoint "\nPick insertion point:" ))
    (setq a (getangle "\nAngle?:" pnt ))(terpri) 
    (setq ang ( * a 57.3))
    (command "layer" "set" "txt" "")
    (command "insert" "sa" pnt scl scl ang) 
    )
    Code:
     inserts 4 way air direction arrows for diffuser
    (defun c:4sa ()
    (SETVAR "OSMODE" 64)
    (SETQ INS (GETPOINT "\NPICK POINT"))
    (COMMAND "ID" INS)
    (setvar "clayer" "txt")
    (setq scl (getvar "dimscale" ))
    (command "insert" "sa" "@15,0" scl scl 0)
    (COMMAND "ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
    (SETVAR "OSMODE" 0)
    )
    chelsea1307,

    See code below.
    Its looking for a layer call txt.
    I added a layer command to make the layer if its not in the drawing.
    Also be sure the block call sa is in the acad search path.
    If you have these layers in the drawing already then skip this.

    Other than that they seem to work. I did not get the error you are referring to.

    It may be possible since the variables in the programs are not declared local and
    may be interferring with another program that may be loaded.
    Just a guess.

    Code:
    ;inserts air direction arrow (supply)
    (defun c:sa ()
    (setq ortho (getvar "orthomode"))
    (setq scl (getvar "dimscale" ))
    (setvar "orthomode" 1)
    (command "_-layer" "_make" "txt" "")    ;I added this line
    (setq pnt (getpoint "\nPick insertion point:" ))
    (setq a (getangle "\nAngle?:" pnt ))(terpri) 
    (setq ang ( * a 57.3))
    (command "_-layer" "_set" "txt" "")
    (command "_-insert" "sa" pnt scl scl ang) ;Make sure this block is in the acad path
    )


    Code:
    ;inserts 4 way air direction arrows for diffuser
    (defun c:4sa ()
    (SETVAR "OSMODE" 64)
    (SETQ INS (GETPOINT "\nPICK POINT"))
    (COMMAND "ID" INS)
    (command "_-layer" "_make" "txt" "")  ;I added this line
    (setvar "clayer" "txt")
    (setq scl (getvar "dimscale" ))
    (command "_-insert" "sa" "@15,0" scl scl 0)  ;Make sure this block is in the acad path
    (COMMAND "_ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
    (SETVAR "OSMODE" 0)
    )

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,708

    Default

    As you do not seem to be defining an error handler in your functions, the error within the *error* function message would be caused by a badly written *error* handler.

    Type this at the command line and try re-running your original lisps:

    Code:
    (setq *error* nil)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  4. #4
    Super Member chelsea1307's Avatar
    Computer Details
    chelsea1307's Computer Details
    Operating System:
    windows xp
    Using
    AutoCAD 2011
    Join Date
    Sep 2008
    Location
    Sacramento, Ca USA
    Posts
    1,109

    Default

    thanks buzzard i will try what you put,
    Lee, should i add that to the lisps? or just check to see if they work after that?
    "The problem is stupidity. I am not saying there should be capital punishment for stupidity, but, why don't we just take the safety labels off of everything and let the problem solve itself? "

  5. #5
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    Quote Originally Posted by chelsea1307 View Post
    thanks buzzard i will try what you put,
    Lee, should i add that to the lisps? or just check to see if they work after that?
    chelsea1307,

    As Lee mentioned, Run that at the command prompt. Its to clear the error handler. Then run your programs again after you have cleared it.

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,708

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Lee Mac View Post
    ... Type this at the command line and try re-running your original lisps...
    ^^^ ^^^
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. Fixing viewport positions in paper space
    By rossi_mac in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 2nd Jun 2009, 11:34 am
  2. Regarding fixing the co-ordinates
    By amitissar99 in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 10th Apr 2009, 06:02 am
  3. Fixing cotes and dashboard pallete confiigurations
    By Marcelo Neri in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 26th Feb 2008, 03:00 pm
  4. Replies: 0
    Last Post: 28th Mar 2006, 06:29 pm
  5. Locking / Fixing 3d objects along a plane
    By Lester in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 10th May 2005, 05:12 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts