Your Custom AutoLISP Routines are Not Loading After Installing Land F/X
sales@landfx.com
+1 805-541-1003

Your Custom AutoLISP Routines are Not Loading After Installing Land F/X

Issue

After installing a Land F/X plugin, you're finding that your custom AutoLISP routines or scripts are not loading

 

Cause

This issue is likely occuring because your office incorrectly refined the S::Startup function using defun.

 

Solution

When refining the S::Startup function, take care to add to it via defun-q. For example, your current code may look like this:

 

(defun S::STARTUP ()
….
) ; S::STARTUP
 
 
 
 
... when it needs to be:
 
(defun-q MY_STARTUP ()
; note, declaring local variables is not allowed within a defun-q
(setq clayer (getvar “CLAYER”)) ; example “local” variable
 ; set all “local” variables to nil
(setq clayer nil)
) ; MY_STARTUP
 
(if (and S::STARTUP (vl-consp S::STARTUP)) ; then add it
 ; but not if already there
(if (not (member (last MY_STARTUP) S::STARTUP))
(setq S::STARTUP (append S::STARTUP MY_STARTUP))
) ; if
 ; otherwise, start fresh
(setq S::STARTUP MY_STARTUP) ; in this fashion, it can be added to with other startup functions
) ; if

It's also a LISP best practice to avoid having a customization file named acad.lsp. Instead, name your customization file after your firm's name or initials, which will identify it as your firm's cutomization file. For example, if your firm is called Billy Bob Landscape Architecture, you can name your customization file BBLA.lsp. Then make sure the code is intended as in the example above.

Last modified on May 11, 2022

Contact

  • Land F/X

Our software tailors AutoCAD® to the needs of landscape architects, irrigation designers, and other professionals. We automate your most tedious tasks and ensure accuracy, giving you more time to design.

Log in to landfx.com:

Username:

Password: