AutoCAD 2014 on Win 7 Pro 64-bit
Hello, I'm new to this forum and have no experience with the Lisp language, though I do have years of experience with programming. We have a script that was written about 13 years ago that seemed to work fine until we replaced the printer that it used. Now we are receiving many errors and I'm not sure what, exactly, needs to change in the script.
Here are the error messages:
Command: PRINTOUT
Enter number of pages to print: 1
Unknown command "INCHES". Press F1 for help.
Unknown command "L". Press F1 for help.
Unknown command "N". Press F1 for help.
Unknown command "W". Press F1 for help.
Unknown command "FIT". Press F1 for help.
Unknown command "C". Press F1 for help.
Unknown command "Y". Press F1 for help.
Unknown command "CTB". Press F1 for help.
Unknown command "Y". Press F1 for help.
Unknown command "N". Press F1 for help.
Unknown command "N". Press F1 for help.
Unknown command "N". Press F1 for help.
Unknown command "Y". Press F1 for help
Here is the script:
;;; 1/26/01 am 12/23/05 updated to work with 2006 jcc
;;; 11/13/09 update printer name for new IP's
(defun c:printout ()
(setq pgs (getint "Enter number of pages to print: ")) ; pgs = number of pages to print
(setvar "cmdecho" 0) ; Turn command Echo off
(setq cpg 1) ; Set current page to 1
(setq bottom (list 0 0)) ; Set bottom left corner of page 1
(setq top (list 10.5 8.0)) ; Set top right corner of page 1
(While (<= cpg pgs) ;test for current page less than or equal to total number of pages
(command "_.plot" "Y" "Model" "'Xerox ECD'" "Letter" "Inches" "L" "n" "w" bottom top "Fit" "c" "y" "monochrome.ctb" "y" "n" "n" "n" "y"); Print odd page
(if (>= pgs (1+ cpg)) ; test for current page less than or equal to total number of pages
(progn (setq bottom (list (car bottom) (+ (cadr bottom) 8.5))) ; advance bottom left corner for plot window
(setq top (list (car top) (+ (cadr top) 8.5))) ; advance top right corner for plot window
(setq cpg (1+ cpg)) ; add one to current page number
(command "_.plot" "Y" "Model" "'Xerox ECD'" "'Letter (8.5 x 11)'" "Inches" "L" "n" "w" bottom top "Fit" "c" "y" "monochrome.ctb" "y" "n" "n" "n" "y"); print even page
(setq bottom (list (+ (car bottom) 11.5) 0.0)); advance bottom left corner for plot window
(setq top (list (+ (car top) 11.5) 8.0)); advance top right corner for plot window
); close progn
); close if statement
(setq cpg (1+ cpg)); add one to current page number
); close while loop
(princ); exit quietly
); close function
Any help and direction you can provide would be greatly appreciated.
Solved! Go to Solution.
Solved by lgabriel. Go to Solution.
The following line in your program is what tells the printer what to do:
(command "_.plot" "Y" "Model" "'Xerox ECD'" "Letter" "Inches" "L" "n" "w" bottom top "Fit" "c" "y" "monochrome.ctb" "y" "n" "n" "n" "y")
First of all, is the new printer driver called "Xerox ECD". If not you will need to change it to the AutoCAD driver that is designated for your new printer.
If it is correct, you need to manually plot one drawing file to your new printer without having the printer dialog box appear. To do this type: -PLOT at the command prompt.
The next prompt will ask: Detailed plot configuration? [Yes/No] <No>: Enter Yes
What will happen next is AutoCAD will prompt a series of configuration questions. As you answer these questions, write down each response in order.
Once you have gone through all of the prompts and your drawing prints properly, revise the Autolisp line of code, shown above, with the new responses in the correct order.
If done right, the program should automatically print your drawing files. Note, you will need to make the changes for both Odd and Even pages
The program fails at below line because the new plotter dont have a paper size called 'Letter'.
(command "_.plot" "Y" "Model" "'Xerox ECD'" "Letter" "Inches" "L" "n" "w" bottom top "Fit" "c" "y" "monochrome.ctb" "y" "n" "n" "n" "y")
Replace the paper size Letter with something that is available on the current printer/plotter.
That was excellent advice. I did a manual plot as you described and wrote the answers down for each question. Yes, Xerox ECD was the correct printer and I have an AutoCAD driver for it. Now, comes the part I'm not sure how to do in the lisp file. The paper size on this printer is called Letter (8.5 x 11"). How do I get it to recognize the literal " without confusing the rest of the statement? The statement, again, is:
(command "_.plot" "Y" "Model" "Xerox ECD" "Letter" "Inches" "L" "n" "w" bottom top "Fit" "c" "y" "monochrome.ctb" "y" "n" "n" "n" "y")
Also, I notice that the file uses command "_.plot" instead of "-plot". Does that make any difference?
Thank you, again!
One additional question. Something changed in the plot options since the program was originally written. After the monochrome.ctb selection the options are:
Print with lineweights which I set to Yes
(This is new for this program) Enter Shade Plot Setting: The program has an N in this place, but there is no N in the options. My options are As Displayed, Legacy Wireframe, Legacy Hidden, Visual Styles, and Rendered. Does anyone know what that option used to say? It might help me pick the correct one in the updated program.
Thank you!