Batch plotting made easy in AutoCAD

30 Nov, 1999 By: Bill Fane

It’s a clear, crisp autumn evening. The seasons are changing. The ski boat and dirt bike are put away for the winter. The ski pass for Whistler is renewed. Time to think about getting the skis out of storage. . .

Suddenly an e-mail rings out: Hey, your column is late. Again.

Some things never change.

Luckily, the Captain already has a topic. Several faithful readers sent e-mails regarding scripts. They want to know if it’s possible to write a script that takes a list of drawing names, opens each one, and plots it. They have several dozen drawings to plot and hope to automate the process.

The good news is you can write a script to do this. “The Learning Curve,” December 1998, talked about such scripts.

The really good news is that there is an easier way to batch plot multiple drawings—the EbatchP function.

Hold it! I heard about that, but when I tried to run it in AutoCAD all I got was an Unknown command error message.

That’s because it’s not an AutoCAD command. EbatchP is a separate, stand-alone, compiled Visual BASIC program. If you did a minimum or custom install of AutoCAD, it may not be installed.

If it is installed, you’ll find the ebatchp.exe program in the directory C:\Program Files\…\Support\EbatchP. The missing directory name \…\ in this sequence depends on whether you run standard AutoCAD, Mechanical Desktop, Architectural Desktop, etc. You can start it from Windows Explorer or from your AutoCAD program group under the Windows Start menu.

I’ll focus on AutoCAD Release 14. The sidebar discusses some differences for AutoCAD 2000.

Once you start, the logo screen advises you that it is called the Extended Batch Plot Utility (hence EbatchP). It launches its own copy of AutoCAD, even if AutoCAD is already running. Next, it brings up a dialog box.

Starting with the Files tab, the first button of interest is Add Drawing. Click it and you get a familiar file selection dialog box. You can use all the usual click, <Shift>, and <Ctrl> actions to select a file or group of files from one or more drives or directories. Click OK to add your selection to those shown in the left window of the main dialog box. If you change your mind, you can highlight one or more items in the list and select Delete Entry.

If you now click on Plot, the utility automatically plots all the drawings in the selected list, and you are finished!

What if I want to use different pen settings, or freeze some layers, or plot a specific view?

There might be a problem if you don’t consider some of the following items.

For starters, EbatchP starts by defaulting to the plot settings that existed when you finished your last plot, as AutoCAD normally does. It also defaults to certain settings found within the drawing file. Specifically, it uses the last plotted defaults for printer selected, pen assignments, paper size, rotation and origin, text fill, hidden lines, and plot to file. It uses the settings from each drawing for things such as frozen/thawed layers, the setting of the DispSilh (display silhouette triangles when doing a hidden plot of a 3D solid) system setting, and the HidePlot settings for model space viewports in paper space.

Need to make more changes?
Click on the Plot Area tab in the EbatchP main dialog box. Iit defaults to plotting scaled to fit the way the drawing display looked on screen the last time it was saved in model space.

But what if I want to plot the extents of paper space at a 1:1 scale?

No problem. Simply click on a filename, then click the appropriate buttons. Repeat for any other drawings that you want to change.

What do you mean, “No problem?” I have 348 drawings to plot. Do I have to manually change them all?

Okay, you have a problem. Luckily, I’ll cover a quick workaround later.

Note that this dialog box also lets you select a specific named view to plot if one or more exists in the drawing.

My next problem is that I need to plot the same drawing several times, each time with a different set of layers turned on or off.

No problem. First, you can select the same file several times and add it to the plot list under the File tab.

Next, the Layers tab displays all the layer names that exist within a highlighted drawing. You can turn layers on or off regardless of their current state in the drawing. You can also have multiple entries with different settings.

Cool, but I also need to use different pen and line width settings, paper size, and paper orientation for different drawings. You said that this all defaults to the last settings run.

Yes, but you can change some or all of these settings for one or more drawings. Open the drawing in AutoCAD, start the Plot command, and set everything the way you want it. This includes paper size, rotation, and origin. Now select the Device and Default selection button and save your plot control parameter settings to a PCP or PC2 file.

Back in the EbatchP dialog box, click on the Files tab. Select one or more files, then click on Associate PCP/PC2 button and find your PCP/PC2 file. This lets you associate your plot control settings with the selected files. This is one of only two EbatchP options that lets you select more than one drawing at a time.

If you do not associate a PCP/PC2 file with a specific drawing, that drawing plots using the settings that were in effect when you started EbatchP.

So far, so good, but it sure would be nice to date-stamp each plot.

Your wish is EbatchP’s command. Click on the Plot Stamping tab. From here you can specify the plot stamp location and orientation. Click on Change to bring up a second dialog box that lets you set the text style and layer.

In addition, you can create specific messages to stamp on the plot. These include a range of predefined fields such as filename, time and date of plot or of the last time the drawing was saved, and the user’s name.

Note that the Plot Stamping dialog also includes an Apply to All button so you don’t have to repeat the settings for every drawing. Just be sure that the specified layer and text style are present in every drawing on the list.

Now here is a quick hint that helps speed things up. You may have noticed that every time you select a drawing in the EbatchP file listing, that drawing opens in AutoCAD. This is obviously necessary so that EbatchP can read the current layer names, view definitions, and so on.

If you know that you will change several settings, pick the drawing once and change all its settings before going to the next one. Attach its PC2 file, set the layers, set the plot area, and then move to the next drawing.

Another trick that speeds things up is to minimize AutoCAD. Your system doesn’t have to spend the time actually displaying the drawing.

Now are you ready to go? Nope. One more thing. Be sure to run a plot test.

A plot test runs through the list of drawings, loads each one, applies the options, but does not actually plot anything. If it hits an error such as a missing xref or font file, it adds it to a log listing, skips over it, and carries on. Within minutes you get an error listing. Remember, it runs faster if you minimize AutoCAD.

Fix the problems and repeat the test. Once you get a clean run, pick Plot and go home. Just make sure the printer or plotter has enough paper and toner or ink.

One more thing
One more minor hiccup might not allow EbatchP to start up. When you launch it or when you open another drawing, AutoCAD must start clean.

If you have an AutoLISP routine that asks for user input such as the user or client name, you must disable it before you run EbatchP.

Almost forgot
We plotted 348 drawings and then discovered that the client’s name was misspelled in the title block. We used a script to repair them, but now I need to plot them all again. Do I have to re-enter all of the settings?

  Did you read this whole column before using EbatchP? At the right-hand side of the Files tab you find two buttons. One lets you save the complete list and all its settings to a simple ASCII text file, while the other lets you load it back in. You can also load a file from disk to append to the current list or you can clear the list to start a new one.

The Batch Plot (BP2) file is in simple ASCII format. Although not recommended, you can edit it with any text editor. Remember to save an original copy!

Here’s the quick workaround that I mentioned. Carefully search and replace to change settings such as Plot from Paper Space and Set Plot Scale for all the files at once. The Help function for EbatchP gives full details on the file format.

There you have it. The AutoCAD command that can save you the most time isn’t an AutoCAD command at all!

And now for something completely different
When you replace the valve stem seals on an engine, you must hold the valves against their seats. However, you don’t need to remove the cylinder head and use a valve spring compressor. You can apply compressed air to an adapter screwed into the spark plug hole, but this requires about 100psi of air for the whole time you work on the engine.

An alternative: feed a length of soft rope into the spark plug hole, leaving one end hanging out. Rotate the crank shaft. The rope is compressed against the valves, holding them up while you remove the keepers. After you install the new seals, pull the rope back out through the spark plug hole.

Batch plots in AutoCAD 2000
AutoCAD 2000 has enough differences from Release 14 in its basic plotting that batch plotting should (and probably will) be the topic of an entire future column by itself.

On the other hand, there are enough similarities that the Release 14 information should give you a good start. For basic plotting tips in AutoCAD 2000, see our Exclusively on the Web column, Tutorial 2000.

First, you’ll find an external program called batchplt.exe in the directory: C:\Program Files\…\Support\Batchplt.

Although AutoCAD 2000 supports having multiple files open at once, Batchplt starts its own copy of AutoCAD, even if one is already running.

The user interface looks completely different from Release 14’s. Rather than a dialog box with tabs, it’s more like a standard Windows application with pull-down menus and toolbars.

A bit of browsing, however, shows that it basically replicates all of the Release 14 functionality using most of the same names and descriptions.

Additional functions support new AutoCAD 2000 features such as multiple paper space layouts, lineweights, and page setups. — B.F.


More News and Resources from Cadalyst Partners

For Mold Designers! Cadalyst has an area of our site focused on technologies and resources specific to the mold design professional. Sponsored by Siemens NX.  Visit the Equipped Mold Designer here!

For Architects! Cadalyst has an area of our site focused on technologies and resources specific to the building design professional. Sponsored by HP.  Visit the Equipped Architect here!