PDA

View Full Version : Plotting with Lisp


david.brissenden
2009-08-11, 03:36 PM
Can someone please tell me where I am going wrong with this printing routine as it is driving me around the bend now...

All it is supposed to do is print the screen on an A4 piece of paper!!
(defun c:PrintA4 () (command "plot" "y" "Model" "\\\\dbr01\\DO LaserJet 8000" "ISO A4 (210.00 x 297.00 MM)" "Millimeters" "L" "N" "E" "F" "C" "Y" "monochrome.ctb" "Y" "A" "N" "N" "Y"))
Basically the problem lies around the papersize / units area:

Enter paper size or [?] <A4>: ISO A4 (210.00 x 297.00 MM)
Command: Millimeters Unknown command "MILLIMETERS". Press F1 for help.
Command: L Unknown command "L". Press F1 for help.
Command: N Unknown command "N". Press F1 for help.
Command: E Unknown command "E". Press F1 for help.
Command: F Unknown command "F". Press F1 for help.
Command: C Unknown command "C". Press F1 for help. Command: Y Unknown command "Y". Press F1 for help.
Command: monochrome.ctb Unknown command "MONOCHROME.CTB". Press F1 for help.
Command: Y Unknown command "Y". Press F1 for help.
Command: A Unknown command "A". Press F1 for help.
Command: N Unknown command "N". Press F1 for help.
Command: N Unknown command "N". Press F1 for help.
Command: Y Unknown command "Y". Press F1 for help.
Command: nil



I have tried using full names instead of abbreviations, for example "millimeters" instead of "m", "Fit" instead of "F" etc...


The biggest frustration is that it all works if I type in everything manually in Acad just not in lisp.


Any help is appreciated.


Thanks

GuinnessCAD
2009-08-11, 04:34 PM
I know that this may not be the complete answer that you are looking for, but why not set up a template file with the above mentioned settings. Then use the publish command to plot using the template as the layout? Or maybe add the layout to every drawing that you work on so it is there for even easier access?

Lastly maybe try just using the command to state:
command "-plot" "y" "Model" "\\dbr01\DO LaserJet 8000" "A4" "Millimeters" "L" "N" "E" "F" "C" "Y" "monochrome.ctb" "Y" "A" "N" "N" "Y"))

david.brissenden
2009-08-12, 07:50 AM
I know that this may not be the complete answer that you are looking for, but why not set up a template file with the above mentioned settings. Then use the publish command to plot using the template as the layout? Or maybe add the layout to every drawing that you work on so it is there for even easier access?

Lastly maybe try just using the command to state:
command "-plot" "y" "Model" "\\dbr01\DO LaserJet 8000" "A4" "Millimeters" "L" "N" "E" "F" "C" "Y" "monochrome.ctb" "Y" "A" "N" "N" "Y"))

Thanks for your help GuinnessCAD. I think I may have solved it but I need a little more testing to be sure before I can say with any certainty :?:

ccowgill
2009-08-12, 01:10 PM
(command ".-PLOT"
"N" ;|Detailed plot configuration? [Yes/No] <No>: N|;
"" ;|Enter a layout name or [?] <Layout1>:|;
pagesetup ;|Enter a page setup name <>:|;
"" ;|Enter an output device name or [?] <current>:|;
"y" ;|Write the plot to a file [Yes/No] <N>: y|;
file ;|Enter file name <\\maverick\engineering\x5405\RCp01001-Layout1.PLT>:|;
"y" ;|Save changes to page setup [Yes/No]? <N> n|;
"y" ;|Proceed with plot [Yes/No] <Y>:|;
) ;_ end of command

here is how we plot using LISP
pagesetup is a predefined variable that tells it which pagesetup to use
file is a predefined name to tell it to plot to a file. Obviously if you want it to print out not print to a file, you would change the write to a plotfile prompt to no and remove the file name line.