Error with LISP routine - "Macro not found"?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm hoping this is something simple that I am missing. Hopefully someone can help me out. I am trying to edit and run a lisp routine that I used at a previous employer in 2012ish. While I was at that job I needed to change the layer colors from our standards to another seperate companies set of layer color standards and this lisp worked great there. Now I am at a different employer and I am trying to edit and tweak the lisp so that it will work with the projects I with now. (One set being our "layout" standards and the other set being our "rough-in" standards.)
The lisp routine has the text file and two excel files that it references. (One excel file for the original layers and one exel file for the "new" layers). The problem is when I run the lisp - it starts to work by first purging all the unused layers in the drawing, but then when it comes time for it to reference the excel file and add the "new" layers it gives me the error "Macro not found". I feel I know a decient amount about CAD, but I know less about Lisp routines and hardly anything about Macros. I'm working on 2015 AutoCAD Architecture. The coding for the lisp is below - any help would be much appreciated.
(defun C:LRIColors ()
;;; Determine which company's colors to use. ;;;
;;
;;
(setq $QCOMPANY
(if $QCOMPANY
$QCOMPANY
""
)
)
(setq PRMPT
"\nEnter which layer colors to use [Layout/Roughin]:"
)
(if $QCOMPANY
(setq PRMPT (strcat PRMPT " <" $QCOMPANY ">: "))
)
(initget
"Layout Roughin"
)
(setq ANS (getkword PRMPT))
(setq $QCOMPANY
(if (> ANS "")
ANS
$QCOMPANY
)
)
(princ)
(prompt $QCOMPANY)
(prompt " was selected. ")
(princ)
;;
;;
;;; Determine which Layer colors to use. ;;;
;;; Replace current colors with selected company's colors. ;;;
;;
;;
(command "undo" "begin")
(setvar "cmdecho" 0)
(setq QSSGET (ssget "_X"))
(command "_copybase" "0,0" QSSGET "")
(command "erase" QSSGET "")
(command "purge" "Layers" "*" "no")
(cond ; Begin Cond
(
(= $QCOMPANY "Roughin")
(command "vbarun"
"MasterLay.dvb!modMain.Create_Layers"
"Roughin_Layers.xls"
)
)
(
(= $QCOMPANY "Layout")
(command "vbarun"
"MasterLay.dvb!modMain.Create_Layers"
"Layout_Layers.xls"
)
)
(t NIL)
) ; End Cond
(command "_pasteblock" "0,0")
(command "explode" (entlast))
(command "purge" "Layers" "*" "no")
(setvar "cmdecho" 1)
(command "undo" "end")
(princ)
;;
;;
;;; Replace current colors with selected layer colors. ;;;
)