Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom acaddoc.lsp causing mechanical toolbar buttons to not load properly.

1 REPLY 1
Reply
Message 1 of 2
bpitech1674
566 Views, 1 Reply

Custom acaddoc.lsp causing mechanical toolbar buttons to not load properly.

For about 4 years we have been using a custom acaddoc.lsp to load customizations in to Autocad when loading. We have always used the Autocad "Flavor" of mechanical and never had an issue. Recently an engineering has decided he would like to work in mechanical, but when he does some buttons don't work, we just get an "unknown command". For instance the construction lines or rectangle do not work. When we load the default acaddoc.lsp it works, but as soon as we replace that one with the custom one it doesn't.

 

This is the default code in acaddoc.lsp and I have tried to add that code to the top of our custom code and I get a different error.

 

(if (= nil genlade)
  (progn
    (princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"))
    (if acadmappend (setq s::startup (acadmappend s::startup)))
  )
)

 

Can someone knowlegable look at this custom code please?

 

;;; This LISP routine is automatically run each time a document is opened.
;;; Avatech Solutions, Inc.  May 2001
;;; BPI Project

(LOAD (findfile "BPIMACROS.lsp"))
(LOAD (findfile "DDARRAY.lsp"))
(LOAD (findfile "DELAYER.lsp"))
(LOAD (findfile "CLOUD.lsp"))
(LOAD (findfile "MPLOTDOC.lsp"))
(LOAD (findfile "PLOTDOC.lsp"))
(load (findfile "rb2.lsp"))
(load (findfile "rb3.lsp"))
(load (findfile "rb4.lsp"))


(defun c:LS () (load (findfile "layr-set.lsp")) (C:LS))
(defun c:O () (load (findfile "osnp.lsp")) (C:O))
(defun c:BELT () (load (findfile "belt.lsp")) (c:BELT))
(defun c:BR () (load (findfile "brk.lsp")) (C:BR))
(defun c:SNP () (load (findfile "snp.lsp")) (C:SNP))
(defun c:EA () (load (findfile "ea.lsp")) (C:EA))
;;(defun c:EC () (load (findfile "elc.lsp")) (C:EC))
(defun c:ET () (load (findfile "et.lsp")) (C:ET))
(defun c:INV () (load (findfile "involute.lsp")) (C:INV))
(defun c:HLX () (load (findfile "helix.lsp")) (C:HLX))
(defun c:SHNUMS () (load (findfile "shnums.lsp")) (C:SHNUMS))
(defun c:SET () (load (findfile "set.lsp")) (C:SET))
(defun c:LP () (load (findfile "lperp.lsp")) (C:LP))
(defun c:PART () (load (findfile "Part_lists.lsp")) (C:PART))
(defun c:MIR () (load (findfile "MIR.lsp")) (C:MIR))
(defun c:IFD () (load (findfile "itemfind.lsp")) (C:IFD))
(defun c:NFL () (load (findfile "nfl.lsp")) (C:NFL))
(defun c:TOPBOM () (load (findfile "TOPBOM.lsp")) (C:TOPBOM))
(defun c:GBR () (load (findfile "Global_block_rename.lsp")) (C:GBR))
(defun c:RBG () (load (findfile "Global_block_rename.lsp")) (C:RBG))
(defun c:OVAL () (load (findfile "oval.lsp")) (C:OVAL))

(defun RESETMENUS ()
  (setq cmdechoo (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (if (= NIL (menugroup "BPI"))
 (progn
  (if (findfile "BPI.cui")
    (progn
   (command "cuiload" "bpi.cui")
     (menucmd "P10=+BPI.pop1")
     (menucmd "P11=+BPI.pop3")
     (menucmd "P12=+BPI.pop2")
   (menucmd "P13=+BPI.pop4")
      );end progn
  ;else
  (alert "BPI.cui file is missing")
  );end if
 );end progn
  );
(princ)
) ;end defun

;;;*********************************************************************
;;;*-*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 (findfile "acadm.arx")
;;  (progn
;;    (if (= nil genlade)
;;      (progn
;;        (princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"))
;;        (if acadmappend (setq s::startup (acadmappend s::startup)))
;;      )
;;    )
;;  )
;;)
;;;*********************************************************************

(defun S::STARTUP ()
  (setq cmdechoo (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (setvar "attdia" 1)
  (setvar "regenmode" 1)
  (setvar "modemacro" "Current Profile: $(getvar,cprofile)  ")
 (setq M1 (menugroup "BPI"))
 (if (/= M1 "BPI")
  (progn
  (if (findfile "BPI.cui")
   (progn
    (command "cuiload" "bpi.cui")
      (menucmd "P10=+BPI.pop1")
      (menucmd "P11=+BPI.pop3")
      (menucmd "P12=+BPI.pop2")
    (menucmd "P13=+BPI.pop4")
   );end progn
  ;else
  (alert "BPI.cui file is missing")
  );end if
  );end progn
 ) ;end if
 (princ)
 
  (princ "\nBPI 2007 Utilities Loaded... ")
  (setvar "cmdecho" cmdechoo)
);end defun

1 REPLY 1
Message 2 of 2

How about putting that default piece as the last item in your acaddoc.lsp instead of the first? As this seems to play with S::Startup, your own definitions are likely overriding it.

 

 

--

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost