Satish Lele
satish.lele@gmail.com


ERROR CODES AND MESSAGES
This page describes the AutoLISP error codes and error messages.
The following table shows the values of error codes generated by AutoLISP. The ERRNO system variable is set to one of these values when an AutoLISP function call causes an error that AutoCAD detects. AutoLISP applications can inspect the current value of ERRNO with (getvar "errno"). The ERRNO system variable is not always cleared to zero. Unless it is inspected immediately after an AutoLISP function has reported an error, the error that its value indicates may be misleading. This variable is always cleared when starting or opening a drawing. Note that the possible values of ERRNO, and their meanings, may change in future releases of AutoCAD.
Value and Meaning
0 No error
1 Invalid symbol table name
2 Invalid entity or selection set name
3 Exceeded maximum number of selection sets
4 Invalid selection set
5 Improper use of block definition
6 Improper use of xref
7 Object selection: pick failed
8 End of entity file
9 End of block definition file
10 Failed to find last entity
11 Illegal attempt to delete viewport object
12 Operation not allowed during PLINE
13 Invalid handle
14 Handles not enabled
15 Invalid arguments in coordinate transform request
16 Invalid space in coordinate transform request
17 Invalid use of deleted entity
18 Invalid table name
19 Invalid table function argument
20 Attempt to set a read-only variable
21 Zero value not allowed
22 Value out of range
23 Complex REGEN in progress
24 Attempt to change entity type
25 Bad layer name
26 Bad linetype name
27 Bad color name
28 Bad text style name
29 Bad shape name
30 Bad field for entity type
31 Attempt to modify deleted entity
32 Attempt to modify seqend subentity
33 Attempt to change handle
34 Attempt to modify viewport visibility
35 Entity on locked layer
36 Bad entity type
37 Bad polyline entity
38 Incomplete complex entity in block
39 Invalid block name field
40 Duplicate block flag fields
41 Duplicate block name fields
42 Bad normal vector
43 Missing block name
44 Missing block flags
45 Invalid anonymous block
46 Invalid block definition
47 Mandatory field missing
48 Unrecognized extended data (XDATA) type
49 Improper nesting of list in XDATA
50 Improper location of APPID field
51 Exceeded maximum XDATA size
52 Entity selection: null response
53 Duplicate APPID
54 Attempt to make or modify viewport entity
55 Attempt to make or modify an xref, xdef, or xdep
56 ssget filter: unexpected end of list
57 ssget filter: missing test operand
58 ssget filter: invalid opcode (-4) string
59 ssget filter: improper nesting or empty conditional clause
60 ssget filter: mismatched begin and end of conditional clause
61 ssget filter: wrong number of arguments in conditional clause (for NOT or XOR)
62 ssget filter: exceeded maximum nesting limit
63 ssget filter: invalid group code
64 ssget filter: invalid string test
65 ssget filter: invalid vector test
66 ssget filter: invalid real test
67 ssget filter: invalid integer test
68 Digitizer isn't a tablet
69 Tablet is not calibrated
70 Invalid tablet arguments
71 ADS error: Unable to allocate new result buffer
72 ADS error: Null pointer detected
73 Can't open executable file
74 Application is already loaded
75 Maximum number of applications already loaded
76 Unable to execute application
77 Incompatible version number
78 Unable to unload nested application
79 Application refused to unload
80 Application is not currently loaded
81 Not enough memory to load application
82 ADS error: Invalid transformation matrix
83 ADS error: Invalid symbol name
84 ADS error: Invalid symbol value
85 AutoLISP/ADS operation prohibited while a dialog box was displayed

Error Messages : When AutoLISP detects an error condition, it cancels the function in progress and calls the user *error* function with a message indicating the type of error. If no user *error* function is defined (or if *error* is bound to nil), the standard error action is to display the message in this form:
error: message
The message is followed by a function traceback. If a user-defined *error* function exists, the traceback does not occur. Instead, the user function is called with message passed as its only argument.
User Program Errors : This subsection describes error messages that you may see while writing and debugging AutoLISP functions. Most of these messages indicate AutoLISP programming errors, such as these:
1. Misspelled function or symbol names
2. The wrong type or number of function arguments
3. Mismatched parentheses
4. Mismatched quotation marks (unterminated strings)
5. Failure to check for proper completion of a function before attempting to use its result

Although these messages usually indicate user programming errors, they may be caused also by programming errors (bugs) in AutoLISP itself. If you can't find anything wrong with your program, fill out a Bug Report form and send it to Autodesk along with a copy of your code (preferably on a floppy disk). arguments of a defun can't have the same name. A function defined with multiple arguments of the same name will fail and generates this message.
1. AutoCAD rejected function : The arguments passed to an AutoCAD function were invalid (as in setvar of a read-only system variable, or tblnext with an invalid table name), or the function itself is invalid in the current context. For instance, you cannot use a getxxx user input function inside the command function.
2. AutoLISP stack overflow : The AutoLISP stack storage space has been exceeded. This can be due to excessive function recursion or very large function argument lists.
3. bad argument type : A function was passed an incorrect type of argument. (For instance, you can't take the strlen of an integer.)
4. bad association list : The list supplied to the assoc function does not consist of key value lists.
5. bad conversion code : An invalid space identifier was passed to the trans function.
6. bad ENTMOD list : The argument passed to entmod is not a proper entity data list (as returned by entget).
7. bad ENTMOD list value : One of the sublists in the association list passed to entmod contains an improper value.
8. bad formal argument list : When evaluating this function, AutoLISP detected an invalid formal argument list. Perhaps the function is not a function at all, but rather a data list.
9. bad function : The first element in the list is not a valid function name. Perhaps it is a variable name or a number. This message can also indicate that the named function is improperly defined. (Keep in mind the required formal argument list.)
10. bad function code : A bad function identifier was passed to the tablet command.
11. bad grvecs list value : Something that was passed in a grvecs list isn't a 2D or 3D point.
12. bad grvecs matrix value : A matrix passed to grvecs is malformed or contains the wrong data type (for example, STR, SYM, and so on).
13. bad list : An improperly formed list was passed to a function. This can occur if a real number begins with a decimal point. You must use a leading zero in such a case.
14. bad list of points : A null list or a list containing items other than points is sent along with an F, CP, or WP request. Used by ssget and grvecs.
15. bad node : Invalid item type encountered by type function.
16. bad node type in list : Invalid item type encountered by foreach function.
17. bad point argument : bad point value. A poorly defined point (a list of two reals) was passed to a function expecting a point. Be careful not to begin a real number with a decimal point; you must use a leading zero in such a case.
18. bad real number detected : An attempt was made to pass an invalid real number from AutoLISP to AutoCAD.
19. bad ssget list : The argument passed to (ssget "X") is not a proper entity data list (as returned by entget).
20. bad ssget list value : One of the sublists in the association list passed to (ssget "X") contains an improper value.
21. bad ssget mode string : Caused when ssget was passed an invalid string in the mode argument.
22. bad xdata list : Caused when xdsize, ssget, entmod, entmake, or txtbox was passed a malformed extended entity data list.
23. base point is required : The getcorner function was called without the required base point argument.
24. Boole arg1 0 or 15 : The first argument to the Boole function must be an integer between 0 and 15.
25. can't evaluate expression : A decimal point was improperly placed, or some other expression was poorly formed.
26. can't open (file) for input -- LOAD failed. The file named in the load function could not be found, or the user does not have read access to the file.
27. can't reenter AutoLISP : The AutoCAD/AutoLISP communication buffer is in use by an active function. No new function can be called until the active one is complete.
28. console break : The user entered CTRL+C while a function was processing.
29. divide by zero : Division by zero is not allowed.
30. divide overflow : Division by a very small value has resulted in an invalid quotient.
31. exceeded maximum string length : A string passed to a function is greater than 132 characters.
32. extra right paren : One or more extra right parenthesis was encountered.
33. file not open : The file descriptor for the I/O operation is not that of an open file.
34. file read--insufficient string space : String space was exhausted while AutoLISP was reading from a file.
36. file size limit exceeded : A file has exceeded the operating system's file size limit.
37. floating-point exception : (UNIX-based systems only.) The operating system has detected an error in floating-point arithmetic.
38. function canceled : The user entered CTRL+C or ESC (cancel) in response to an input prompt.
39. function undefined for argument : The argument passed to log or sqrt is out of range.
40. function undefined for real : A real number was passed as an argument to a function requiring an integer--for instance, (lsh val 1.2).
41. grvecs missing endpoint : The vector list passed to grvecs is missing an endpoint.
42. illegal type in left : The .lsp file is not pure ASCII, but was saved by a word processing program, and the file includes formatting codes.
43. improper argument : The argument to gcd is negative or zero.
44. inappropriate object in function : An improperly constructed function has been detected by the vmon function pager.
45. incorrect number of arguments : The quote function expects exactly one argument, but some other number of arguments was supplied.
46. incorrect number of arguments to a function : The number of arguments to the user-defined function does not match the number of formal arguments specified in the defun.
47. incorrect request for command list data : A command function was encountered but cannot be executed due to another active function, or the command interpreter is not fully initialized. This can happen from a command function call in the acad.lsp, acadr13.lsp or a .mnl file.
48. input aborted : An error or premature end-of-file condition has been detected, causing termination of the file input.
49. insufficient node space : There is not enough heap space to accommodate the requested action. See chapter 15, "Memory Management."
50. insufficient string space : There is not enough heap space to accommodate the specified text string. See chapter 15, "Memory Management."
51. invalid argument : Improper argument type, or argument out of range.
52. invalid argument list : A corrupted argument list was passed to a function.
53. invalid character : An expression contains an improper character.
54. invalid dotted pair : Dotted pairs are lists containing two elements separated by a space-period-space construction. You might get this error message if you begin a real number with a decimal point; you must use a leading zero in such a case.
55. invalid integer value : A number smaller than the smallest integer, or larger than the largest integer, was encountered.
56. LISPSTACK overflow : The AutoLISP stack storage space has been exceeded. This can be due to excessive function recursion or to very large function argument lists.
57. malformed list : A list being read from a file has ended prematurely. The most common cause is a mismatch in the pairings of opening and closing parentheses or quotation marks.
58. malformed string : A string being read from a file has ended prematurely.
59. misplaced dot : A real number begins with a decimal point. You must use a leading zero in such a case.
60. null function : An attempt was made to evaluate a function that has a nil definition.
61. quit/exit abort : The quit or exit function has been called.
62. string too long : A string passed to setvar is too long.
63. too few arguments : Too few arguments were passed to a built-in function.
64. too few arguments to grvecs : Not enough arguments were passed to grvecs.
65. too many arguments : Too many arguments were passed to a built-in function.
backBack top