Jump to content

Macro Beginner - Automated print


Barneel

Recommended Posts

Can somebody help me out with learning macros? I've been fiddling around with them on a basic level for a while now, but I was hoping somebody could help me understand how to do an instant automated print.

 

I looked on a few websites and they all sort of just force-fed the final result rather than explaining it, which meant I couldn't manipulate it to do what I wanted. Below is the macro I ended up with after attempting to manipulate it myself (but it doesn't work). Can anyone help me get it working? And explain what I've done wrong and how to avoid it in future?

 

^C^C-plot;y;;\\SBS2008\OKI ES8460 MFP;A3 297 x 420 mm ;m;l;n;l;1:1;0.00,0.00;y;monochrome.ctb;y;n;n;n;;n;y;

 

Attached are the plot settings I'm trying to achieve

 

Plot Macro2.png

 

Thanks

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • Barneel

    10

  • dbroada

    4

  • ReMark

    3

  • MSasu

    2

Top Posters In This Topic

Posted Images

Just call -PLOT command (please note the hyphen, it will run in prompt mode), choose Detailed Configuration and write down the answers to prompts; use these to built the script, separated by ";" or spaces.

Link to comment
Share on other sites

A macro uses the command line version of an AutoCAD command along with the standard input the user would type in. In your case the plot command is being invoked and everything that AutoCAD needs to know about plotting your drawing has to be answered by you before the macro will work.

 

What is it that you would like to do that you are having trouble with? What plot parameters do you wish to follow?

Link to comment
Share on other sites

Thanks for your responses!

 

That's a really good tip MSasu! I followed through the command and came up with this:

^C^C-plot;y;;\\SBS2008\OKI ES8460 MFP;A3 297 x 420 mm;M;L;N;E;F;C;Y;monochrome.ctb;N;A;n;n;y;

 

However it seems to be getting stuck at the Plotter name stage:

"\\SBS2008\OKI ES8460 MFP"

Probably because of the backslashes. It works when I enter it manually however. Is there a way to force quote this?

 

 

Thanks Remark, MSasu answered 95% of what I wanted in 1 sentence! This is what I'm trying to achieve step by step:

 

-Plot

Detailed: Y

Layout name: ;

Output device name: \\SBS2008\OKI ES8460 MFP

Paper Size: A3 297 x 420 mm

paper units: millimeters

Drawing Orientation: Landscape

Upside down?: N

Plot Area: Extents

Plot Scale: Fit

Plot offset: Center

Plot styles?: Y

Plot style: monochrome.ctb

Lineweights?: N

Shade plot setting: As Displayed

Write plot to file?: N

Save changes to page setup? N

Proceed with plot: Y

Link to comment
Share on other sites

That didn't resolve the issue unfortunately :(

 

EDIT:

 

^C^C-plot;y;;//SBS2008/OKI ES8460 MFP;A3 297 x 420 mm;M;L;N;E;F;C;Y;monochrome.ctb;N;A;n;n;y;

Link to comment
Share on other sites

I cannot test that, but please try to double the back-slashes:

\\[color=magenta]\\[/color]SBS2008\[color=magenta]\[/color]OKI ES8460 MFP

Link to comment
Share on other sites

Compare the printer name pretty sure when doing this the spaces are removed in the name, in particular when using networks the \\ need to be done different.

 

An example from this post (setq plottername "\\\\PRODPRN03\\100B........) note \\\\ & \\

 

http://www.cadtutor.net/forum/showthread.php?69132-Printing-LISP-Help...&highlight=Printing-LISP

Link to comment
Share on other sites

I will check on Monday but that is pretty much what I have.

 

After a quick re-read, I think I have to put my printer name in quotes to get it to work but I will check if you haven't sorted it by then.

 

One thing to be aware of though is SOMETIMES the answers you give on the command line are different to those given in a script/macro! One that has caught me out in a batch plot routine is the question asked about saving changes. One asks "Do you want to save changes" while the other asks "do you want to discard changes". If something looks odd press F2 and check the questions carefully.

Edited by dbroada
bit about quotes added
Link to comment
Share on other sites

As Dave said the quotes are important, you need to put the plotter name and sheet size all in quotes. A space in your macro is interpreted as a return. You must also replace back slashes with forward slashes. A backslash in a macro is a pause for use input.

Link to comment
Share on other sites

Hi,

Thanks for all your replies. I have just had a go at everything mentioned here, as well as combinations of them. It still seems to be getting stuck on this step however. I'm fairly certain I have plotter name correct - selecting "?" on:

"-Plot, Enter an output device name or [?]"

provides a list of plot devices, and lists my printer as "\\SBS2008\OKI ES8460 MFP"

If there is another way to check if this is correct please let me know!

 

You are correct in saying backslashes make it pause for user input - I didn't know this. However replacing them with forwardslashes doesn't fix it. Attached is a screencap of F2, showing it is able to record the entire printer name (because it tells me /SBS2008//OKI ES8460 MFP> was not found), but is not able to use it.

 

(Also, I'm aware I could just leave this step blank and let it select it as the default plotting device, but it won't always be the case that it is the default).

 

plot1.png

 

 

Any further tips as to where I might be going wrong? I really appreciate all your help so far!

Link to comment
Share on other sites

I think you have too many \ in your first line. Its telling you the default (\\SBS2008\OKI etc.) but you have supplied //SBS2008//OKI etc.

 

This is my button code...

 

 
^C^C-PLOT;Y;Layout1;EUGBHORPD026;A3 (297 x 420 mm);M;L;N;E;F;0,0;Y;STL Mono.ctb;Y;N;N;N;N;N;Y

As you have seen, scripts just continue so if you get one bit wrong it continues until it gets an answer that fits - sometimes with bad results.

 

I have just realised that that one looks for a .pc3 file so doesn't need the path to the printer. In my script files the line that calls the printer is

 

"\\eugbhorfile003\EUGBHORPD026"

Edited by dbroada
didn't read my post well enough
Link to comment
Share on other sites

Well spotted. Unfortunately that still hasn't fixed it.

 

plot2.png

 

Also tried it without the path:

 

plot3.png

 

And without spaces without the path:

 

plot4.png

Link to comment
Share on other sites

have you tried it within quotes? I get way without quotes as I don't have spaces in the device name.

 

"[url="file://\\SBS2008\OKI"]\\SBS2008\OKI ES8460 MFP[/url]"[url="file://\\SBS2008\OKI ES8460 MFP"]
[/url]

Edited by dbroada
quote marks get deleted. :(
Link to comment
Share on other sites

I have tried it as follows:

 

^C^C-plot;y;;"OKI ES8460 MFP";A3 297 x 420 mm;M;L;N;E;F;C;Y;monochrome.ctb;N;A;n;n;y;
^C^C-plot;y;;"OKIES8460MFP";A3 297 x 420 mm;M;L;N;E;F;C;Y;monochrome.ctb;N;A;n;n;y;
^C^C-plot;y;;"OKI_ES8460_MFP";A3 297 x 420 mm;M;L;N;E;F;C;Y;monochrome.ctb;N;A;n;n;y;

 

I have also tried the above without quotes, with the path at the start, with "/" instead of "\" and a combination of these 3 variations.

 

Any other thoughts? I'm determined to make this work!

Link to comment
Share on other sites

Resolved!

 

Re-read what you said about the command looking for a .pc3 and I realised my printer wasn't set up as a .pc3 file. So I set it up as a .pc3 file by going to

C:\Users\"XXX"\AppData\Roaming\Autodesk\AutoCAD Electrical 2014\R19.1\enu\Plotters

Then choosing "Add-A-Plotter Wizard", which creates a .pc3 file for the printer.

 

Working macro below:

 

^C^C-plot;y;;SGT_PRINTY;A3 297 x 420 mm;M;L;N;E;F;C;Y;monochrome.ctb;Y;A;N;N;Y;

 

Thanks for everyones help!

 

EDIT: Slight alteration to Macro to allow for lineweights

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...