Jump to content
Cholomanchuten

¿How do i print by script? ¿Can i choose printer?

Recommended Posts

Cholomanchuten

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

Share this post


Link to post
Share on other sites
nukecad

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.

Share this post


Link to post
Share on other sites
Cholomanchuten

Outstandingly accurate!

 

It works... for now... i'll get back if I have any problem.

 

Thanks a lot!

Share this post


Link to post
Share on other sites
Cholomanchuten

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?

Share this post


Link to post
Share on other sites
nukecad

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.

Share this post


Link to post
Share on other sites
Cholomanchuten

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! :P

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...