Tổng hợp các thông báo lỗi trong lúc chạy AutoLisp trong AutoCAD 2007 2010 2016, cách viết lisp cad, file .lsp

Autolisp hay còn gọi tắt là lisp, là những đoạn code ngắn gọn được viết ngay trên nền AutoCAD, giúp thực hiện được những lệnh vẽ hoặc lênh hiệu chỉnh nâng cao hay bao gồm nhiều lệnh nhỏ bên trong. Dùng Autolisp sẽ tối ưu hơn trong việc thể hiện bản vẽ, rút ngắn thời gian thao tác với các lệnh cơ bản thông thường.

Tổng hợp các thông báo lỗi trong lúc chạy AutoLisp của phần mềm AutoCAD 2007 2010 2012 2016


Dưới đây mình sẽ liệt kê 1 vài thông báo lỗi hay gặp khi bạn thực hiện các Lisp trên phần mềm AutoCAD
- malformed list on input
Code thiếu 1 hoặc nhiều dấu “)”.

extra right paren on input
Code thừa dấu “)”.

malformed string on input
Code chưa string thiếu dấu “.

too many arguments
Hàm gọi thừa đối số so với yêu cầu.

too few arguments
Hàm gọi thiếu đối số so với yêu cầu .

Function cancelled
Người dùng nhấn Esc trong quá trình thực hiện.

quit / exit abort
Either the (exit) or (quit) function has been evaluated.
Hàm (exit) hoặc (quit) được thực hiện.

Application ERROR: Console break
Người dùng ấn Esc khi đang thực hiện.
Và 1 số lỗi khác nữa
bad argument type: numberp: <value>
A function requiring a numerical argument has been passed an argument of incorrect data type with the value noted in the error message.

bad argument type: fixnump: <value>
A function requiring an integer argument has been passed an argument of incorrect data type with the value noted in the error message.

bad argument type: stringp <value>
A function requiring an argument of 'String' data type has been passed an argument of incorrect data type with the value noted in the error message.
bad argument type: lselsetp <value>

A function requiring a Selection Set argument has been passed an argument of incorrect data type with the value noted in the error message.
bad argument type: lentityp <value>

A function requiring an Entity argument has been passed an argument of incorrect data type with the value noted in
the error message.
bad argument type: listp <value>

A function requiring a List argument has been passed an argument of incorrect data type with the value noted in the error message.
bad argument type: consp <value>

A function requiring a List argument has been passed an argument of incorrect data type with the value noted in the error message.
bad argument type: FILE <value>

A function requiring a File Descriptor argument has been passed an argument of incorrect data type with the value noted in the error message.
bad argument type: VLA-OBJECT <value>

A function requiring a VLA-Object argument has been passed an argument of incorrect data type with the value noted in the error message.
bad argument type: (or stringp symbolp): <value>

A function requiring either a string or symbol argument (such as getvar or setvar) has been passed an argument of incorrect data type with the value noted in the error message.
Unknown command "example". Press F1 for help.

The command you are attempting to call is not defined. This could be the result of a LISP program not being loaded, a command not being available in the version you are running or by including too many 'enter' calls ("") in a command expression.

no function definition: VLAX-GET-ACAD-OBJECT
no function definition: VLAX-ENAME->VLA-OBJECT
The Visual LISP extensions for AutoLISP have not been loaded with the (vl-load-com) function. Add (vl-load-com) to your ACADDOC.lsp or to the code you are trying to run, outside of any function definitions.
no function definition: <name>

The program is attempting to evaluate a function with name as noted in the error message which is not defined. This could be the result of a missing function definition, or perhaps (vl-load-com) missing from the code.
bad function: <name>

A symbol or variable whose value is not a function is being evaluated as a function. Probable cause is a literal list not quoted, causing the first item in the list to be evaluated as a function.
ActiveX Server returned the error: unknown name: <name>
The program is attempting to access a VLA-Object property or method with the name as noted in the error message which is not available for that object.
ActiveX Server returned an error: Invalid index
The program is attempting to use the vlax-safearray->list function to convert an empty safearray to a list.
Automation Error. Key not found
The program is attempting to use the Item method of a VLA Collection Object to access an item not present in that collection.
vlax-safearray-fill failed. Invalid initialization list.
The program is attempting to use the vlax-safearray-fill function to populate a safearray with an incorrect number of items.
divide by zero
An divisor function (such as rem or /) is attempting to divide by zero.
bad ssget mode string
The mode string argument (such as "_X") passed to the ssget function is incorrect.
bad point argument
The ssget function has been passed an invalid point list argument, or none at all.
bad SSGET list value
One or more items in a filter list supplied to the ssget function are invalid