rmoore
2005-10-03, 07:09 PM
We are in the process of switching over from AutoCAD 2004 to AutoCAD Mechanical 2006. In past AutoCAD versions, I had always loaded custom lisp routines via the s::startup routine in the acaddoc.lsp file. WIth mechanical, when I open that file I get this:
;;;*-*TXT acad.lsp is loaded once, acaddoc.lsp is loaded for each
;;; document, s::startup in any case is called after acaddoc.lsp
;;; has been loaded
;
;;(if (= nil acad_helpdlg)
;; (progn
;; (load "acadr15.lsp")
;; (load (strcat (getvar "menuname") ".mnl"))
;; )
;;)
(if (= nil genlade)
(progn
(princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"))
(if acadmappend (setq s::startup (acadmappend s::startup)))
)
)
This is the line that I dont understand:
(if acadmappend (setq s::startup (acadmappend s::startup)))
I tried putting the s::startup code after the if statement, which worked, but then some of the mechanical functions stopped working and I would get error messages like this:
amconsthor ; error: no function definition: GENLADEThe code for the acadm.lsp file is formated in a way that makes it difficult for me to decipher.
Here is the code for the acadm.lsp file mentioned in the acaddoc.lsp lisp routine:
(defun AcadMappend(startup / )(if (cond ((/= T(load"gen/genbas0.lsp"T))T)((/= T(load"gen/genbas0.ll"T))T)((/= T (if ge0geniusdir (load(strcat ge0geniusdir"gen/genbas0.lsp")T) T )) T )((/= T (if geniuspd (load(strcat(geniuspd)"gen/genbas0.lsp")T) T )) T )(T nil) )(append (list (if startup (car startup) nil )(list (quote acadmstartup)))(cdr startup))(progn (prompt"\nAcadM Error: file genbas0.lsp not loaded.") startup ))) (defun genneuzeich()(redraw))(if(=(type *error*)'SUBR)(setq *error* nil))(if(not special)(defun special(a)a)) (defun c:amlayer_con1()(command"_amlayer""_o""con1")(princ))(defun c:amlayer_con2()(command"_amlayer""_o""con2")(princ))(defun c:amlayer_con3()(command"_amlayer""_o""con3")(princ))(defun c:amlayer_hidw()(command"_amlayer""_o""hidw")(princ))(defun c:amlayer_hidn()(command"_amlayer""_o""hidn")(princ))(defun c:amlayer_hlin()(command"_amlayer""_o""hlin")(princ))(defun c:amlayer_dili()(command"_amlayer""_o""dili")(princ))(defun c:amlayer_txt3()(command"_amlayer""_o""txt3")(princ))(defun c:amlayer_cenw()(command"_amlayer""_o""cenw")(princ))(defun c:amlayer_cenn()(command"_amlayer""_o""cenn")(princ))(defun c:amlayer_hatch()(command"_amlayer""_o""hatc")(princ))(defun c:amlayer_vpli()(command"_amlayer""_o""vpli")(princ))(defun c:amlayer_phan()(command"_amlayer""_o""phan")(princ)) (defun c:amunit_0()(gensv)(gendimsetdecimals 0)(command"_UNITS"2 0 1 0 0"_N")(genprompt"xx.")(genun)(princ))(defun c:amunit_1()(gensv)(gendimsetdecimals 1)(command"_UNITS"2 1 1 1 0"_N")(genprompt"xx.x")(genun)(princ))(defun c:amunit_2()(gensv)(gendimsetdecimals 2)(command"_UNITS"2 2 1 2 0"_N")(genprompt"xx.xx")(genun)(princ))(defun c:amunit_3()(gensv)(gendimsetdecimals 3)(command"_UNITS"2 3 1 3 0"_N")(genprompt"xx.xxx")(genun)(princ))(defun c:amunit_4()(gensv)(gendimsetdecimals 4)(command"_UNITS"2 4 1 4 0"_N")(genprompt"xx.xxxx")(genun)(princ)) (princ)
Can anyone help me get both my startup routine and the mechanical to work together?
Thanks in advance for your help!
;;;*-*TXT acad.lsp is loaded once, acaddoc.lsp is loaded for each
;;; document, s::startup in any case is called after acaddoc.lsp
;;; has been loaded
;
;;(if (= nil acad_helpdlg)
;; (progn
;; (load "acadr15.lsp")
;; (load (strcat (getvar "menuname") ".mnl"))
;; )
;;)
(if (= nil genlade)
(progn
(princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"))
(if acadmappend (setq s::startup (acadmappend s::startup)))
)
)
This is the line that I dont understand:
(if acadmappend (setq s::startup (acadmappend s::startup)))
I tried putting the s::startup code after the if statement, which worked, but then some of the mechanical functions stopped working and I would get error messages like this:
amconsthor ; error: no function definition: GENLADEThe code for the acadm.lsp file is formated in a way that makes it difficult for me to decipher.
Here is the code for the acadm.lsp file mentioned in the acaddoc.lsp lisp routine:
(defun AcadMappend(startup / )(if (cond ((/= T(load"gen/genbas0.lsp"T))T)((/= T(load"gen/genbas0.ll"T))T)((/= T (if ge0geniusdir (load(strcat ge0geniusdir"gen/genbas0.lsp")T) T )) T )((/= T (if geniuspd (load(strcat(geniuspd)"gen/genbas0.lsp")T) T )) T )(T nil) )(append (list (if startup (car startup) nil )(list (quote acadmstartup)))(cdr startup))(progn (prompt"\nAcadM Error: file genbas0.lsp not loaded.") startup ))) (defun genneuzeich()(redraw))(if(=(type *error*)'SUBR)(setq *error* nil))(if(not special)(defun special(a)a)) (defun c:amlayer_con1()(command"_amlayer""_o""con1")(princ))(defun c:amlayer_con2()(command"_amlayer""_o""con2")(princ))(defun c:amlayer_con3()(command"_amlayer""_o""con3")(princ))(defun c:amlayer_hidw()(command"_amlayer""_o""hidw")(princ))(defun c:amlayer_hidn()(command"_amlayer""_o""hidn")(princ))(defun c:amlayer_hlin()(command"_amlayer""_o""hlin")(princ))(defun c:amlayer_dili()(command"_amlayer""_o""dili")(princ))(defun c:amlayer_txt3()(command"_amlayer""_o""txt3")(princ))(defun c:amlayer_cenw()(command"_amlayer""_o""cenw")(princ))(defun c:amlayer_cenn()(command"_amlayer""_o""cenn")(princ))(defun c:amlayer_hatch()(command"_amlayer""_o""hatc")(princ))(defun c:amlayer_vpli()(command"_amlayer""_o""vpli")(princ))(defun c:amlayer_phan()(command"_amlayer""_o""phan")(princ)) (defun c:amunit_0()(gensv)(gendimsetdecimals 0)(command"_UNITS"2 0 1 0 0"_N")(genprompt"xx.")(genun)(princ))(defun c:amunit_1()(gensv)(gendimsetdecimals 1)(command"_UNITS"2 1 1 1 0"_N")(genprompt"xx.x")(genun)(princ))(defun c:amunit_2()(gensv)(gendimsetdecimals 2)(command"_UNITS"2 2 1 2 0"_N")(genprompt"xx.xx")(genun)(princ))(defun c:amunit_3()(gensv)(gendimsetdecimals 3)(command"_UNITS"2 3 1 3 0"_N")(genprompt"xx.xxx")(genun)(princ))(defun c:amunit_4()(gensv)(gendimsetdecimals 4)(command"_UNITS"2 4 1 4 0"_N")(genprompt"xx.xxxx")(genun)(princ)) (princ)
Can anyone help me get both my startup routine and the mechanical to work together?
Thanks in advance for your help!