see what lisp files are loaded?

Discussion in 'AutoCAD' started by C Witt, Aug 20, 2004.

  1. C Witt

    C Witt Guest

    Is there a way to get a list of all the lisp files that are loaded in
    the current session of cad (not the lisp commands)? (and generate that
    list in lisp?)
     
    C Witt, Aug 20, 2004
    #1
  2. C Witt

    R.K. McSwain Guest

    I'm going to go out on a limb here and say no. The "lisp file" is just
    an instrument to hold lisp code until it's loaded into memory. You can
    easily write lisp functions at the command line that will be loaded into
    memory without ever loading a 'lisp file'. You can also load a 'lisp
    file' that contains no lisp code. In the same regard, you can load a
    file that contains lisp code but that has a non-lisp file extension, for
    example, a file named "mylisp.xls".

    I suppose it's possible to write some sort of reactor to catch files
    that are loaded. But this itself would have to be running from the start.

    I'm interested to hear other thoughts.
     
    R.K. McSwain, Aug 20, 2004
    #2
  3. C Witt

    John Uhden Guest

    Yes. Download and install McNeel's DOSLIB for your version.
    There's a (dos_lisplist) function that provides exactly what you want.

    Be sure to send the ever benevolent author, Dale Fugier, a big Thank You.
     
    John Uhden, Aug 20, 2004
    #3
  4. You could add a "save lisp file name" to a variable for to every lisp file
    you have.

    Example - "test.lsp" file
    ; test.lsp file
    (defun C:XX () (princ "\nMy XX program"))
    (defun C:YY () (princ "\nMy YY program"))
    ; add lisp file name to MY_LISP_FILES_LOADED variable
    (if (not (member "TEST.LSP" MY_LISP_FILES_LOADED)) (setq
    MY_LISP_FILES_LOADED (append MY_LISP_FILES_LOADED (list "TEST.LSP"))))
    ;end of test.lsp file

    The you need a lisp routine to list the currently loaded lisp files.
    (defun C:LIST_LISP ()
    (princ "\nLisp Files Loaded - ")
    (foreach FILENAME MY_LISP_FILES_LOADED (princ (strcat "\n" FILENAME)))
    (princ)
    )
     
    Alan Henderson @ A'cad Solutions, Aug 20, 2004
    #4
  5. C Witt

    C Witt Guest

    There must be some way.. because if you run "appload" you can see a list of
    every lisp file loaded..

    it's just a question of how to access that list.
     
    C Witt, Aug 20, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.