Chapter 24

AutoCAD Plays Well with Others

IN THIS CHAPTER

Bullet Exporting AutoCAD DWG files to other file formats

Bullet Importing other file formats into AutoCAD

Bullet Dealing with translation issues

So your drawing masterpiece is ready to go. Chapter 16 covers plotting to paper, and Chapter 20 discusses the gory details of transmitting drawing files via the Internet. So far, so good. But what if you want to include all or part of a drawing as an illustration in a written report? What if you need to send a drawing to someone who is using a CAD program other than AutoCAD? No problem. This chapter starts by discussing several different processes for extracting drawing information in a variety of file formats.

Next, we come to the flip side. What if you receive a drawing file that isn’t in DWG format? Okay, maybe not a problem. AutoCAD can import and edit several other file formats.

This chapter concludes with a section on some of the possible pitfalls of dealing with file format translations.

Get Out of Here!

AutoCAD has several processes for exporting drawings in formats other than DWG. In fact, it often has more than one process for the same format.

In Chapter 1, I discuss the difference between the two fundamental file formats for storing graphic images. Virtually all CAD programs use a vector format, in which the file contains definitions and properties for each object type such as a line, a circle, and an arc. Most other graphic programs use some variant of a raster (bitmap) format, wherein the file simply contains a mapping of the color of each of the tiny dots (pixels) that produce the image on screen.

The bad news is that if you want to include CAD drawings in most non-CAD applications, well, many cannot handle a vector format. The good news is that AutoCAD can produce a raster file that can then be inserted into things like a Word document file.

Things that go BMP in the night

The most basic raster image file is a simple bitmap, usually with the file extension BMP (usually pronounced “bump”). The file consists mostly of a whole bunch of numbers that correspond to a color number for every individual pixel. One problem with BMP files is that they are not compressed, so as the resolution (the number of rows and columns) goes up, the file size goes up exponentially. If you, say, double the resolution, the file size quadruples.

The file size problem can be greatly reduced by using any one of several file compression techniques. The basic principle of file compression is that the software looks for repetitions and then describes them appropriately. For example, if green is color number 3, a horizontal green line in a BMP file would be stored as “3 3 3 3 3 3 3 3 3 3 3 3.” A compressed file would store the same information as “12x3,” which obviously requires less space. The bad news is that some compression formats achieve higher compression rates by filtering finer details, so that “3 3 3 3 3 3 4 3 3 3 3 3” might still be stored as “12x3.” The false information is called an artifact. Artifacts may not be a problem in busy photographs but are a problem when details are lost from CAD images.

The most common compressed raster file formats are JPG (“jay-peg”), which is used by digital cameras, PNG (“ping”), which is used on websites, and TIF (“tiff”), which is used in desktop publishing.

You can extract a raster image from AutoCAD in several ways, ranging from convenient to flexible:

  • Press Alt+PrtSc on your keyboard. This method captures the current screen view of the current application to the Windows clipboard. You can now paste it directly (with Ctrl+V) into many other applications or into a graphics program such as Paint for further editing, cropping, and saving to a variety of raster formats. This keystroke combination works equally well for any Windows application, by the way, and is convenient because there are no options to choose.
  • Use the EXPORT EXPort command. This method saves drawings to a file on the hard drive in a variety of raster and vector formats. For use in non-CAD applications, the two formats to consider are WMF (Windows metafile) and BMP (bitmap). This command allows you to select which entities to export; press Ctrl+A to select all visible ones. Other than that, there are no options to consider.
  • Use the PLOT command. Refer to Chapter 16, where I discuss plotting. The Printer/Plotter Name drop-down list includes Publish to Web JPG and Publish to Web PNG. When you select either, the Paper Size drop-down list displays a variety of image resolutions.

    You may need to do a bit of playing with the Plot Area and Plot Scale values to get what you want. Extents and Fit to Paper are usually good starting points.

Warning Doing a screen capture or a plot to a raster file is strictly a case of WYGIWYS (what you get is what you see). If a detail is small enough that it isn’t visible onscreen at the time the image was captured, it isn’t in the raster file and no amount of zooming in will bring it back. The only way a raster image can be resized is by dropping or adding pixels. Resizing smaller will result in loss of detail, which can sometimes mess up a drawing image. In addition, resizing bigger usually restores the lost detail unless you’re in the lab of CSI, in which case enlarging an image reflected from an eyeball retains full resolution. I strongly recommend that you play with the capture settings so that the image can be inserted 1:1 in the target document, without the need to resize it.

The three panels of Figure 24-1 show possible side effects of resizing a raster image.

Image described by caption and surrounding text.

FIGURE 24-1: How to mess up a raster image.

Vectoring in on WMF

Many people are familiar with the common image formats that I mention earlier in this chapter because they are in widespread use on the Internet. What most people, including dedicated CAD geeks, don’t know is that Windows supports a vector format called a Windows Meta File (WMF, pronounced “wmf”).

Many Windows applications, Word in particular, let you insert a WMF file as an illustration. The big advantage of this is that WMF is a mixed raster-vector file format, which means that you can zoom in or out all you want without losing details. Oh, small stuff may not be visible if you zoom out too far, but it hasn’t gone away if you zoom back in. After you insert a WMF file into a Word document, you can resize it at will to fit the available space without losing clarity or detail.

Microsoft Paint will also open a WMF file but will convert it to a BMP image.

To export a drawing in the WMF format, just do the following:

  1. On the Application menu, choose Export  ⇒  Choose Other Formats.

    The Export Data file dialog box appears.

  2. In the Files of Type drop-down list, select Metafile (*.wmf).
  3. Enter a suitable file name and then click Save.
  4. When AutoCAD asks, select the drawing objects to be exported.

    When you finish selecting, the file is created.

Tip If instead of Step 1 you enter the WMFOUT command at the keyboard, AutoCAD jumps directly to Step 4.

And now here are the lumpy bits

Tip The first major issue with exporting a drawing to a WMF file is that the objects to be exported have to be visible onscreen and they must all reside in model space or paper space. For example, if your border and title block reside in a paper space layout and a viewport shows model space, exporting a WMF file from paper space will capture only the border, title block, and viewport boundary — and nothing from model space.

Fortunately, there is a simple solution. By the way, have you noticed that I almost never bring up a problem unless I also have a solution? Anyway, all you need to do is to be in the desired paper space layout. Now go to the Application menu, choose Save As, and then click Save Layout as a Drawing. From here, the steps are self-explanatory. All visible objects from both universes are collected, and then everything is copied into the model space of a new drawing. Now you can export the new drawing as a WMF file.

Remember The second issue involves framing. When you create a WMF file, its boundary is determined by the visible area of the screen and not by the extents of the objects you select. This means that if you have zoomed out to the full extents of your drawing but just select a few objects, the resultant image when inserted into a Word document will show a large white area with your selected objects showing as a very small detail. The solution is to zoom and frame your objects so that they just fill the screen before you select them. This process can even include stretching and shrinking the height and width of the drawing window.

PDF

The PDF file format by Adobe Systems has become the de facto standard for many types of information exchange. Much of this derives from its name: PDF stands for Portable Document Format. In the early days of computing, a document created on the PC version of Word couldn’t be opened by the Mac version and vice versa. On the other hand, a PDF file can be opened and displayed by any Windows or Mac computer or any iOS or Android device, such as a tablet or an iPhone. All you need to view it is the appropriate free reader app from Adobe.

To generate a PDF version of an AutoCAD DWG file, simply go to the Application menu and choose Export ⇒ PDF. The rest is pretty obvious.

What the DWF?

The AutoCAD DWG format works well for storing drawing information on local and network drives, but the high precision and large number of object properties that AutoCAD uses make for comparatively large files.

To overcome this size problem and to encourage people to publish drawings on the web, Autodesk developed an alternative lightweight vector format for representing AutoCAD drawings: Design Web Format (DWF, pronounced “dwiff”). A DWF file is a more compact representation of a DWG file. DWF uses less space because it’s less precise and doesn’t have all the information that’s in the DWG file. Therefore, it takes less transfer time over the web and by email.

Use the EXPORTDWF command to create a DWF file. Click the Application menu and then click the Export button to use the EXPORTDWF command.

Technical stuff DWFx is a version of regular DWF that’s compliant with Microsoft’s XML Paper Specification (XPS). Had your fill of alphabet soup yet? Everything about DWF in this chapter also applies to DWFx. The DWFFORMAT command determines whether the PUBLISH, 3DDWF, and EXPort commands output to DWF or DWFx. If this sounds like a topic that might be important in your work, look up DWFFORMAT in the online Help system. Windows Vista through Windows 10 include an XPS Viewer, and the long and the short of this feature is that drawings plotted to DWFx can be viewed automatically in these Windows versions without AutoCAD or any special viewing software.

On the other hand, Autodesk seems to have come to the realization that PDF is the dominant force in this area and no longer fully supports DWF.

3D Print

Okay, all you old Star Trek fans! The Matter Replicator exists! Well, not really, but 3D printing is getting pretty close. The good news is that this section of the book is short.

AutoCAD is able to export 3D solids and watertight 3D meshes in the industry-standard STereoLithography (STL) file format, which can be used by virtually any type, brand, and model of 3D printer. I cover 3D in Chapter 21.

To export an STL file, follow these steps:

  1. On the Application menu, choose Export  ⇒  Choose Other Formats.

    The Export Data file dialog box appears.

  2. In the Files of Type drop-down list, select Lithography.
  3. Enter a suitable file name and click Save.

Tip You can also send your file directly to a 3D printing service bureau, which will 3D print the model and mail it to you — for a fee, of course. On the Application menu, choose Publish ⇒ Send to 3D Print Service.

But wait! There’s more!

Between them, AutoCAD’s print, export, save as, and publish functions can export drawing files into about 30 different file formats. These formats includes the ones already discussed in this chapter, plus several other CAD formats. Plus AutoCAD can roll newer AutoCAD files back to earlier releases.

Open Up and Let Me In!

Among other things, Chapter 18 discusses how and why to attach raster images, PDF files, and external references (XREFs) to an AutoCAD drawing file.

Editing other drawing file formats

AutoCAD can also create, open, edit, and save a number of other file formats, including several other brands of CAD software. I won’t go into all the ins and outs here, but I will give you a hint: On the Application menu, look at the options under Open and under Import, and then click the Files of Type drop-down list to see the list of supported formats.

PDF editing

AutoCAD 2017 added the capability of editing PDF files. From a practical point of view, this is viable only if the PDF was created by exporting a drawing file from AutoCAD or another CAD program. Yes, AutoCAD can edit a PDF that came from a Word document, for example, but trust me, you don’t want to do that.

To edit a PDF drawing, do this:

  1. Open a new or existing drawing file.
  2. On the Application menu, choose Import ⇒ PDF.
  3. Press Enter.
  4. Browse to and select the desired PDF file using the file dialog box that has appeared.
  5. Click Open.

    The Import PDF dialog box shown in Figure 24-2 appears.

  6. Click OK.

    For your first try, I suggest you go with the defaults.

Image described by caption and surrounding text.

FIGURE 24-2: The Import PDF dialog box.

Magic! This looks exactly like the original drawing that was used to create the PDF! Even all the text, dimensions, colors, layers, and linetypes are correct.

Yes, AutoCAD can now edit a PDF file, but (and it’s a big, uppercase, bold BUT — not to be confused with a big butt) before you get all excited at the prospect, you may want to consider the following discussion of some of the limitations. It’s possible that these may be inherent in the PDF format or with AutoCAD’s capability to analyze the file or both.

First, all complex object types have been exploded to their basic constituents. For example, all block insertions, hatch patterns, text, and dimensions have been reduced to a bunch of individual polylines. That’s right, every line segment in a complex hatch pattern has become an individual, independent polyline segment. Similarly, dimensions get exploded to polylines and text, and are no longer associated with the original definition points.

Worse yet, some text is totally exploded. TrueType fonts survive as lines of text, but the individual characters in AutoCAD’s SHX fonts get redefined as a bunch of polyline segments.

I’m not finished! Curves such as splines and arcs also end up as a multitude of straight polyline segments.

Ah, but I saved the worst for last. In Chapter 8 in particular, I harp on the need for accuracy in AutoCAD drawings. Unfortunately, the PDF file didn’t read that chapter, and so most objects seem to come in with sizes that vary from the original drawing in the third and fourth decimal place. This may not sound like much, but you will now find that a line that is supposed to be tangent to an arc or two lines that are supposed to touch at their ends possibly don’t.

Other than that, PDF editing is perfect.

Okay, the good news is that later releases have greatly improved on importing PDF files. I won’t go into all the gory details, but two significant ones follow:

  • Non-continuous lines: If you select the Infer Linetypes from Collinear Dashes box in the Import PDF dialog box, AutoCAD will try to guess which standard linetype variant was used to create the original non-continuous linetypes. This feature can significantly increase the processing time to import the PDF file, especially if you have a lot of crosshatching that uses noncontinuous linetypes.
  • AutoCAD SHX fonts: AutoCAD created their proprietary font file, known as SHX fonts, in the days before standard TrueType fonts. Most current drawings probably use TrueType fonts, but older drawings or current drawings started from an older template will use SXH fonts. If you insert a PDF file and encounter text that consists of many small line segments instead of individual characters, you have SHX characters.

    AutoCAD 2018 added the capability to convert all those little line segments into text. Click the Recognize SHX Text button on the Insert tab of the Ribbon. You will be invited to select objects that you believe to be text. AutoCAD will then analyze them and try to match them to one of four of its most probable SHX fonts. If it succeeds, it will produce a single editable text object of all the characters. If it fails, you need to use the SEttings option of the command to select one or more fonts out of 78 possible ones. The good news is that AutoCAD remembers any selected fonts for future conversion attempts.

Translation, Please!

As indicated earlier in this chapter, AutoCAD can both import and export drawing files from several brands of CAD software.

Warning No translation is perfect, whether of computer file formats or of human languages. Neither of them have exact equivalencies for certain items or terms. The first test of any translation is to do a round trip out and back into the original format, and then look for the differences. For example, legend has it that programmers did a round-trip test when they were writing the first human-language translators. What went in was “The spirit is willing but the flesh is weak.” What came back was “The booze is okay but the meat’s gone bad.” Even rolling an AutoCAD DWG file back to an earlier release can cause loss of things such as parametrics or 3D objects that didn’t exist in the earlier release.

You have probably guessed by now that AutoCAD isn’t the only CAD program on the market, nor is it even the only one that can process files with the DWG format. A number of programs, ranging from lower-cost to free, claim to be AutoCAD compatible.

Varying degrees of “compatible” exist, and compatibility isn’t necessarily a function of price. Degrees of compatibility range from AutoCAD object types that don’t exist in the compatible programs but can still be displayed to objects that can be damaged or destroyed by a round trip.

Examples of some of the varying degrees of compatibility include the following:

  • 3D: Other CAD programs may not be able to create or edit 3D solids and surfaces, may not be able to display them, and might even strip them out of an incoming DWG file.
  • Self-scaling annotations: Other CAD programs may not be able to create or edit self-scaling annotations or display more than the first scaled variant applied to an object. Some programs might strip out the other scales, so they don’t survive a round trip.
  • Parametrics: Other CAD programs may not support editing of parametric values. Some programs might strip out the parametrics so that they don’t survive a round trip.
  • Tables: I discuss tables in Chapter 13. They are basically spreadsheets that can be inserted into an AutoCAD drawing. They can then do such things as read values from AutoCAD objects or external Excel spreadsheets into individual cells and extract cell values out to linked Excel spreadsheets. Earlier releases of AutoCAD, and some other CAD programs, don’t support these features. At best, the tables will be translated into simple line elements and text objects that display the current cell value. Connectivity will be lost. At worst, the table may disappear entirely.

The bottom line is that you should conduct round-trip cycles on test files before committing hard data.

The Importance of Being DWG

To take full advantage of AutoCAD in your work environment, be aware of the DWG file format — the format in which AutoCAD saves drawings. Here are some DWG facts to keep in mind:

  • In many cases, an older release of AutoCAD can’t open a DWG file that’s been saved by a newer AutoCAD release. Table 24-1 shows the relationship between AutoCAD versions and their corresponding file formats.
  • A newer release of AutoCAD can always open files saved by older versions. I have sample files dating back to 1984 that open in AutoCAD 2020.
  • Some previous AutoCAD releases can open files saved by a subsequent version or two. As Table 24-1 shows, Autodesk changed the DWG file format every three years or so starting in 2000 but has leveled off recently so that drawings created in or saved by AutoCAD 2017 can be opened with AutoCAD 2013 and later.
  • You can use the Save As option in a newer release to save a file to an older DWG format. In fact, AutoCAD 2020 can Save As all the way back to AutoCAD Release 14, in the last millennium (1997). In addition, you can save a file as a simple text-based DXF format as far back as Release 12 (1992). Table 24-1 shows which versions use which DWG file formats.

    Warning Earlier formats may not support all the features of later formats. AutoCAD does its best at translating, but some items may be lost or may not fully survive the round trip to an older release and back to the newer one.

TABLE 24-1 AutoCAD Versions and DWG File Formats

AutoCAD Version

AutoCAD LT Version

DWG File Format

AutoCAD 2018-2020

AutoCAD LT 2018-2020

AutoCAD 2018

AutoCAD 2013–2017

AutoCAD LT 2013–2017

AutoCAD 2013

AutoCAD 2010–2012

AutoCAD LT 2010–2012

AutoCAD 2010

AutoCAD 2007–2009

AutoCAD LT 2007–2009

AutoCAD 2007

AutoCAD 2004–2006

AutoCAD LT 2004–2006

AutoCAD 2004

AutoCAD 2000, 2000i, 2002

AutoCAD LT 2000, 2000i, 2002

AutoCAD 2000

AutoCAD R14

AutoCAD LT 1998, 1997

AutoCAD R14

AutoCAD R13

AutoCAD LT 1995

AutoCAD R13

AutoCAD R11, R12

AutoCAD LT R2

AutoCAD R11

So, do you have to use AutoCAD to produce DWG files? The answer is no. Several low-cost to no-cost programs claim to be compatible with AutoCAD’s DWG file format. They usually come with a few crunchy bits, however.

  • Because these programs have to reverse-engineer the file format, they are often one release behind AutoCAD’s current version.
  • These programs usually don’t fully support all AutoCAD features because of copyright, patent, or perceived market size limitations. In particular, annotative objects (Chapters 13-15), parametrics (Chapter 19), and 3D models (Chapters 21-23) may not survive unscathed from a round trip to the other brand and back to AutoCAD.
  • Yes, a line is a line and a circle is a circle in a DWG file, but the commands that you use in other programs to put them in the file may not operate in the same way.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.239.148