Cholomanchuten Posted July 13, 2010 Share Posted July 13, 2010 The question is pretty straightforward. I have a .dwg who runs a script at startup. I need to write in this script a command that prints. The problem is that "print" command opens a dialog box and i can't write the order in the script. Is it possible to print by script. And in the case that this is possible: i would very much like to choose the printer, other than the default one. IF NOT, it doesn't matter, I just need the first part of the question. Thanks a lot! Javier Quote Link to comment Share on other sites More sharing options...
nukecad Posted July 13, 2010 Share Posted July 13, 2010 Try using '-plot' instead of 'print'. NOTE the hypen (-) in front of the 'p', this gives the command line version of 'plot' with no dialogue box. For some reason 'print' wont do this command line trick. So a typical script to plot the current drawing at A3 would look something like - -plot y \\srvr\TOSHIBA e-STUDIO4300 A3 (297 x 420mm) m l n e f c y monochrome.ctb y n n n n y y although the sequence of commands may be different depending on which Acad version you are using. Quote Link to comment Share on other sites More sharing options...
Cholomanchuten Posted July 13, 2010 Author Share Posted July 13, 2010 Outstandingly accurate! It works... for now... i'll get back if I have any problem. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Cholomanchuten Posted July 13, 2010 Author Share Posted July 13, 2010 New question: I have a problem scripting the the //srvr\TOSHIBA e-STUDIO4300 because it has spaces between and autocad considers them as "enters". Any tips? Quote Link to comment Share on other sites More sharing options...
nukecad Posted July 14, 2010 Share Posted July 14, 2010 I would be suprised if it worked for you anyway, that is the address of one of our printers here. Unless you have a Toshiba e-studio4300 installed on a print server called 'srvr' ? (And when run as a script the spaces in the name give me no problems here). You need to put your own printers name there. You will also probably have to change the line that gives the paper size to one that is listed in your printer software. (You could just give a return rather than the printer name in which case you would get the last printer that was used with that drawing; but if that printer was at a different office or if the drawing had not been printed before you would probably get an error). Also note that in a script you have to use a backstash '\' as the pathname delimiter rather than the usual forward slash '/'. Try running through the command line version of plot on your machine, just type in -plot, and note the responses that you give to the prompts. These responses are what you need to have in your script. One further thing to mention; when I run that particular script in model space I get an 'unknown command "y" ' after running it. This is because there are less parameters for the command line version of plot in modelspace than there is in paperspace. So the extra 'y' is needed for paperspace and I just ignore it if I use the script to plot from modelspace. Quote Link to comment Share on other sites More sharing options...
Cholomanchuten Posted July 14, 2010 Author Share Posted July 14, 2010 Nice, it works! I knew that i should put the name of my printer, I changed it but it still gave me an error; but solved it anyway now. Thanks a lot! Anyway, check that Toshiba of yours. Maybe the paper came out through your printer! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.