TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: HasanCAD on December 14, 2010, 04:49:50 AM
-
When Run a lisp this error message comes but when repeat the same lisp working good
; error: An error has occurred inside the *error* functionbad argument type:
VLA-OBJECT nil
This is erorr subroutine
(defun *error* (msg)
(if oldEcho (setvar "CMDECHO" oldEcho))
(if oSnp (setvar "OSMODE" oSnp))
(if oZin (setvar "DIMZIN" oZin))
(if mSp (vla-EndUndoMark actDoc))
(princ msg)
(princ)
)
-
The only VLA Object there is actDoc
Perhaps it is nil.
-
Perhaps add something like this to the *error* function
;;----- Display error message if applicable _---------------------------
(cond
((not msg)) ; no error, so do nothing
((member (strcase msg t) ; if cancel or quit
'("console break" "function cancelled" "quit / exit abort")
)
)
((princ (strcat "\nApplication Error: " (itoa (getvar "errno")) " :- " msg))
;;----- Display backtrace ------------------------------------------
(vl-bt)
)
)
-
Thanks Kerry