How to run a lisp script?

Hello,

I'm  trying to work with some lisp scripts but wasn't able to run i.e. thebatchplot.lsp

The help file just shows how to load the file (_appload), but nothing else. How can i run it?

Thank you!

 

Best regard.

Comments

  • The simplest way is to drag and drop the lisp routine you want to load onto your drawing. In the case of BatchPlot.lsp this won't work as it has dependency on another lisp routine called sysvarstack.lsp, which may be why appload isn't working for you. If you want to make use of lisp, vba, scripts etc. I suggest that you:

    1. Create a CAD Library folder either on your local machine, or centrally on your network if you have one.
    2. In Bricscad add the  CAD Library folder(s) to your support file search path.
    3. Copy any routines you wish to use to your CAD Library.

    Once you have done this drag and drop should work, as well as appload. You can also load a lisp routine from the command line by using the load function e.g.

    (load "batchplot.lsp")

    Lisp files can be viewed and edited with a text editor. functions starting with (defun C:SOMENAME are defining a command that you can call from Bricscad once loaded. e.g.

    batchplot.lsp defines a function called c:batchplot. To run this function in Bricscad you type batchplot at the command line and press enter.

     

    hope this make sense.

     

    Regards,

     

    Jason Bourhill

    CAD Concepts

    http://www.cadconcepts.co.nz

  • To clarify - some lisps just start and do what they do when they are loaded, most you have to type the 'start word' after you load it.

    Very often the start word is the same as the name of the routine, occasionally it's something different like 'go'.

    Some lisps drop a hint at the command line when they are loaded, like "ColouredText", so you type that and then it will run.

    If you haven't been given a hint and typing the lisp's name won't work, open the file as Jason says and the clue is right at the beginning of the file, as in (defun C:XXXX.... - that means you type XXXX to run the lisp after it's loaded.

    The typical line in a popup Menu to open and run a lisp in one click is (load "XXXX");XXXX. The ';' can be a space.

  • Ah, that will help!

    Thank you very much!

     

    Best regards.

This discussion has been closed.