View Full Version : Undefine the dasboard and adcenter in lisp
GuinnessCAD
2008-02-11, 03:27 PM
We are in the process of adding this routine to the startup of every drawing in AutoCAD. This could be added to acaddoc.lsp, but if we change the lisp, it is much easier to change from a single server location rather than ~1000 local machines. I have added (princ) to my routine, but for some reason my commands are not undefining. Any ideas? Also please do not ask why would you want to do that for undefining those commands? It is a standards issue, and that is where I am leaving that. (I just do not want to open Pandora's box about best practices, just looking for a solution). Thank you for your time in advace programming gurus.
;;Routine to cleanup drawings upon opening of file
;;Created by Mark LaBell on 1/14/2008
;;Edited by Mark LaBell on 1/23/2008
(setvar "cmdecho" 0)
(command "-purge" "b" " " "n")
(command "-purge" "b" " " "n")
(command "-purge" "b" " " "n")
(command "-purge" "r" " " "n")
(command "audit" "y")
(command "undefine" "dashboard")
(command "undefine" "adcenter")
(setvar "cmdecho" 1)
(princ)
We are in the process of adding this routine to the startup of every drawing in AutoCAD. This could be added to acaddoc.lsp, but if we change the lisp, it is much easier to change from a single server location rather than ~1000 local machines. I have added (princ) to my routine, but for some reason my commands are not undefining. Any ideas? Also please do not ask why would you want to do that for undefining those commands? It is a standards issue, and that is where I am leaving that. (I just do not want to open Pandora's box about best practices, just looking for a solution). Thank you for your time in advace programming gurus.
;;Routine to cleanup drawings upon opening of file
;;Created by Mark LaBell on 1/14/2008
;;Edited by Mark LaBell on 1/23/2008
(setvar "cmdecho" 0)
(command "-purge" "b" " " "n")
(command "-purge" "b" " " "n")
(command "-purge" "b" " " "n")
(command "-purge" "r" " " "n")
(command "audit" "y")
(command "undefine" "dashboard")
(command "undefine" "adcenter")
(setvar "cmdecho" 1)
(princ)
Hi Mark,
Have you tried placing it in a S::Startup function so it is the last thing that loads?
(defun-q MYSTARTUP ( )
(command "undefine" "dashboard")
(command "undefine" "adcenter")
)
(setq S::STARTUP (append S::STARTUP MYSTARTUP))
Not tested, just an idea...
GuinnessCAD
2008-02-11, 10:24 PM
Hi Mark,
Have you tried placing it in a S::Startup function so it is the last thing that loads?
(defun-q MYSTARTUP ( )
(command "undefine" "dashboard")
(command "undefine" "adcenter")
)
(setq S::STARTUP (append S::STARTUP MYSTARTUP))
Not tested, just an idea...
Funny you should mention that, what I ended up finding out, and sorry for not posting earlier is that I needed to run the command before undefining it, weird.:roll:
;;Routine to cleanup drawings upon opening of file
;;Created by Mark LaBell on 1/14/2008
;;Edited by Mark LaBell on 1/23/2008
;;;(defun C:clean ()
(setvar "cmdecho" 0)
(command "-purge" "b" " " "n")
(command "-purge" "b" " " "n")
(command "-purge" "b" " " "n")
(command "-purge" "r" " " "n")
(command "audit" "y")
(command "_dashboard")
(command "_dashboardclose")
(command "undefine" "_dashboard")
(command "_adcenter")
(command "_adcclose")
(command "undefine" "adcenter")
(setvar "cmdecho" 1)
(princ)
(prompt "\n Welcome to SSOE, Inc. AutoCAD 2008")
(princ)
;;;)
ccowgill
2008-02-12, 01:36 PM
We are in the process of adding this routine to the startup of every drawing in AutoCAD. This could be added to acaddoc.lsp, but if we change the lisp, it is much easier to change from a single server location rather than ~1000 local machines. I have added (princ) to my routine, but for some reason my commands are not undefining. Any ideas? Also please do not ask why would you want to do that for undefining those commands? It is a standards issue, and that is where I am leaving that. (I just do not want to open Pandora's box about best practices, just looking for a solution). Thank you for your time in advance programming gurus.
I am confused on your statement. If you have the ~1000 machines all with a common path to the server location as the first item in the list, you can have them all load the same acaddoc.lsp and have it load all the custom routines. I have our custom routines working out of two separate offices, with a total of 3 departments, and about 2 dozen computers. I have the acaddoc.lsp file define which user gets which main routine loaded and sets paths for each office. then I have 2 main routines that load all the sub routines, and all the subroutines are located in their own individual files. - confusing enough?
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.