Loading multiple Lisp files

Hi there,

I'm looking to use a number of Lisp files I first created in AutoCAD and use them here in Bricscad. In AutoCAD there is the ability to to combine them into a VLX file.

I am looking for a little advice on how best to handle this in Bricscad. Should simply add all the routines into one larger Lisp file?

Can the files be brought in automatically when Bricscad starts?

Thank you in advance for your help.

--
Phillip

Comments

  • "On_start.lsp" in the user's Bricscad support folder is loaded every time the user opens a drawing file.

    You can make any LSP file load automatically by putting a line in "On_start.lsp" with this format:

    (load "C:/Lisp Routines/MyLisps.lsp")

    You can put as many routines in each LSP file as you want.

     

  • Thanks for your help Anthony.

    Phillip

  • If you have a lot of LISP routines and do not always want to have them all loading each time you create or open a drawing look into using autoload in your on_doc_load.lsp

    ;; Automatically load Alignview.lsp on TPV or DTV command(autoload "AlignView.lsp" '( "TPV" "DTV" ))

     

     

     

  • I do essentially the same as Greg .. with the following addition ;

    ;;==================================

    (defun c:DTV ( / ) (c:AlignView_D) )

    (defun c:TPV ( / ) (c:AlignView_T) )

    (autoload "AlignView.lsp" '( "TPV" "DTV" ))

    ;;==================================

    This allows modification of alias shortcuts from one file, keeping the original source intact and allowing the use of longer routine names which are more likely to be unique.

    ... and lets me use a single file for each routine.

    The autoloads are defined in an application MNL file .. ie if the MNU isn't loaded, the routines don't load.

    My shared Library file for  functions supporting routines is loaded from a 'LOAD" call in the same MNL

    Regards

    Kerry

     

  • Ooooh... I like that addition.

    Thanks for sharing it!

This discussion has been closed.