Autoloading of VLX file

Discussion in 'AutoCAD' started by rgrainer, Feb 11, 2004.

  1. rgrainer

    rgrainer Guest

    (setq lsp-dir "c:/data/lisp/")

    (autoload (strcat lsp-dir"_MYLISP") '("abc" "123" ))

    the above shows my current autoloading for various functions ie "abc" and
    "123". That is those two function reside in MYLISP.LSP and entering "abc"
    will load it on demand. All works well..... but now I want to compile the
    MYLISP file to a VLX . How do I make the call to autoload a VLX file when a
    request is made to a function contained within the main file. For example as
    it would appear in a menu might be something like:

    ID_abc [Function abc]^c^c (if (null c:abc)(vl-load-all "mylisp.vlx"));abc

    would the following then be proper way to autoload MYLISP.VLX ? :

    (vl-load-all (strcat lsp-dir"_MYLISP") '("abc" "123" ))

    Is the there a way to autoload a compiled vlx function. I tried help but it
    was not clear

    Thanks

    Richard
     
    rgrainer, Feb 11, 2004
    #1
  2. Autoload is defined in acad200?doc.lsp

    if you make the changes below autoload wil work on fas & vlx lisp files

    ;;;Original ai_ffile fiunction
    ;;;(defun ai_ffile (app)
    ;;; (or (findfile (strcat app ".lsp"))
    ;;; (findfile (strcat app ".exp"))
    ;;; (findfile (strcat app ".exe"))
    ;;; (findfile (strcat app ".arx"))
    ;;; (findfile app)
    ;;; )
    ;;;)

    ;;;Modified ai_ffile function
    (defun ai_ffile (app)
    (or (findfile (strcat app ".lsp"))
    ;; lines added to allow autoloading of fas & vlx files========
    (findfile (strcat app ".fas"))
    (findfile (strcat app ".vlx"))
    (findfile (strcat app ".exp"))
    (findfile (strcat app ".exe"))
    (findfile (strcat app ".arx"))
    (findfile app)
    )
    )

    ;;;Original ai_nofile function
    ;;;(defun ai_nofile (filename)
    ;;; (princ
    ;;; (strcat "\nThe file "
    ;;; filename
    ;;; "(.lsp/.exe/.arx) was not found in your search path folders."
    ;;; )
    ;;; )
    ;;; (princ "\nCheck the installation of the support files and try again.")
    ;;; (princ)
    ;;;)

    ;;;Modified ai_nofile function
    (defun ai_nofile (filename)
    (princ
    ;; lines added to reflect searching for all file types in function
    "ai_ffile"========
    (strcat
    "\nThe file "
    filename
    "(.lsp/.fas/.vlx/.exp/.exe/.arx) was not found in your search path
    folders."
    )
    )
    (princ
    "\nCheck the installation of the support files and try again."
    )
    (princ)
    )
     
    Mark Gardiner, Feb 11, 2004
    #2
  3. rgrainer

    RichardG Guest

    Thanks Mark worked like a charm
    and a simple fix too
    Richard
     
    RichardG, Feb 11, 2004
    #3
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.