S::STARTUP Function
In the previous post about Startup Lisp Functions, the special (S::STARTUP) function was mentioned. Startup lisp code is loaded before the drawing is initialized, but you cannot call the (COMMAND) function until after the drawing is initialized. The solution is to place your (COMMAND) calls inside the (S::STARTUP) function.
For example, if you want to reset the scale list and purge out regapps each time a drawing is opened, you could use something like this:
(defun-q mystartup () (command "._purge" "_R" "*" "_N") (command "._-scalelistedit" "_R" "_Y" "_E") ) (setq S::STARTUP (append S::STARTUP mystartup))
Notice that we did not directly define (S::STARTUP). Because this function can be defined in other places, it is best to append to it rather than overwrite it. Use (defun-q) to create a function defined as a list, so it can be appended. To finish the example from the previous post...
;;; acaddoc.lsp (load "mylisp") (load "another_lisp") (load "\\\\server\\share\\a_lisp_and_specify_the_path") (setvar "blipmode" 0) (setvar "highlight" 1) (defun-q mystartup () (command "._purge" "_R" "*" "_N") (command "-scalelistedit" "_R" "_Y" "_E") ) (setq S::STARTUP (append S::STARTUP mystartup)) ;;; end acaddoc.lsp
All content is copyright © CAD PANACEA 2005-2011 unless otherwise noted.
All content of CAD PANACEA is solely my own personal thoughts and opinions and do not those of any other entity or person.
All comments posted to this blog are the sole responsibility of the person making the comment.
Google, as a third party vendor, uses cookies to serve ads on this site. Google's use of their cookies enables it to serve ads to users based on their visit to your sites and other sites on the Internet. You may opt out of the use of these cookies by visiting the Google ad and content network privacy policy.

Recent comments
1 day 12 hours ago
1 day 15 hours ago
2 days 17 hours ago
4 weeks 2 days ago
7 weeks 1 day ago
7 weeks 1 day ago
7 weeks 1 day ago
7 weeks 1 day ago
12 weeks 21 hours ago
12 weeks 2 days ago