AutoCAD/acad.lsp

Advertisement


Question
Hello,
What would the code be to see if a lisp is already loaded
and if it is don't load it again.

Thanks!

Answer
I do something like this:

(defun c:setup ()
  (load "setup")
  (c:setup)
)

this defines a "stub" command that gets overwritten when the lisp file loads.

you can also do something like
(if (null c:setup) (load "setup"))

where the variable you check is something that gets defined when the file loads.

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scott Cook

Expertise

I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience

Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.

©2012 About.com, a part of The New York Times Company. All rights reserved.