(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
Labels: AutoCAD, Programming, Tips
PermaLink Posted 8/18/2008 08:10:00 PM
Comment from:
Date: August 19, 2008 at 7:10:00 AM CDT
so if my acad.lsp and custom MNL file only use functions like autoload, load, princ, prompt and setenv, then am I correct in saying that I don't need to use the S::STARTUP concept?
Comment from: R.K. McSwain
Date: August 19, 2008 at 12:22:00 PM CDT
Only (command) functions need to go in the (S::STARTUP) function.
I have seen instances where certain (command) functions work even if they are not defined in (S::STARTUP), but that is not guaranteed.
Comment from:
Date: September 29, 2008 at 7:14:00 AM CDT
interesting procedure, i've used commands such as
;creates thaws and turns on defpoints
(if (tblsearch "LAYER" "defpoints");;test if layer exists
(command "-layer" "thaw" "defpoints" "on" "defpoints" "") ;do this if exists
(command "-layer" "n" "defpoints" "c" "63" "defpoints" "");do this if not
)
which are quite lengthy with out it erroring... maybe i'm missing something?? Or your way is cleaner or better?
-Hammer
Comment from:
Date: September 29, 2008 at 7:20:00 AM CDT
To quote the AutoCAD developers guide...
"the command function, ... is not guaranteed to work until after a drawing is initialized."
So, it *may* work, but no promises.