Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Autocad 2005 And Autocad LT 2005 Bible (2004).pdf
Скачиваний:
92
Добавлен:
17.08.2013
Размер:
32.22 Mб
Скачать

Working with Other Applications

Your drawing is not a world unto itself. Many times you need to work with files or data from other applications. Here are some

possibilities:

Working for a client who uses another CAD program

Placing a logo into your title block

Inserting a drawing into a report

Inserting a spreadsheet into your drawing

Using a satellite photo as a basis to create a map You have several ways of working with other applications:

You can import another file format so that the entire file is brought into your drawing.

You can export to another file format so that the entire drawing can be imported into another application.

You can import a raster image (bitmap) without changing any file format. A raster image is made up of dots, called pixels, as opposed to vectors. AutoCAD and AutoCAD LT are vector programs.

You can import, or export to, a DXF file, which is a way of interchanging drawings between AutoCAD or AutoCAD LT and other CAD programs.

As you can imagine, the possibilities are endless. This chapter explains how to work with other applications.

Importing and Exporting Other

File Formats

27C H A P T E R

In This Chapter

Coordinating AutoCAD and AutoCAD LT with other data

Importing and exporting other file formats

Working with raster images

Pasting, linking, and embedding objects

You can export to several other file formats, thereby enabling you to save the file in another format. You can also import several formats. This section explains how to do both.

838 Part V Organizing and Managing Drawings

Exporting drawings

You usually export objects to an image format and then use that format in another application. You may also export a drawing to import it into another CAD program. Table 27-1 shows the file formats AutoCAD and AutoCAD LT can create. Except as noted, you are prompted to select objects to export.

 

 

 

Table 27-1: Export File Formats

 

 

 

 

 

 

Format

Description

 

 

 

 

 

 

WMF

Windows Metafile Format — a Windows vector format.

 

 

ACIS

A solid modeling file format stored as .sat files, in text (ASCII) form. (AutoCAD only)

 

 

STL

Exports a single solid only in a format usable with stereolithography. (AutoCAD only)

 

 

BMP

Windows bitmap — a raster format.

 

 

EPS

Encapsulated PostScript — a format used by certain printers to create high-quality text

 

 

 

and images. Exports all objects.

 

 

3DS

The format used by Autodesk Viz; can be imported into Discreet’s 3D Studio Max. It

 

 

 

is an interchange format similar to the way DXF is to CAD, but the 3DS file format is

 

 

 

designed for 3D-based programs. (AutoCAD only)

 

 

DXF

Drawing Interchange Format is a text format for CAD drawings that most CAD

 

 

 

programs accept. You can choose from Releases 2004, 2000, and 12 DXF file formats.

 

 

 

Exports the entire drawing.

 

 

DXB

Another format for transferring CAD drawings, but in binary format (not text) and used

 

 

 

less often than the DXF format.

 

 

DWF

Drawing Web Format — a format for placing a drawing on a Web site.

 

 

JPG

Joint Photographic Expert Group — a raster (bitmap) format commonly used on the

 

 

 

Web. It can be compressed but will lose some detail. Often used for photographs

 

 

 

because it supports many colors.

 

 

TIF

Tagged Image File Format — a raster (bitmap) format often used for scanned images.

 

 

 

Provides good quality.

 

 

PNG

Portable Network Graphics — a raster (bitmap) format that supports many colors and

 

 

 

also compresses well without losing detail. It also supports transparency.

 

 

 

Cross-

For more information on the DWF file format, see the next chapter.

Reference

 

 

Exporting to DXF format

DXF (drawing interchange file) format is a text file that contains all the information in a 2D drawing. Because most CAD programs accept this format, you can export to DXF and send the file to someone else who can import it into another CAD program. Figure 27-1 shows the part of a DXF file that defines a line. Not only are objects defined, but all layers, linetypes, and other settings are defined as well. The file lists codes that specify a certain type of data (for example, the X coordinate of a line’s endpoint), followed by the values for the codes (for example, 7.55).

Chapter 27 Working with Other Applications

839

Object

X coordinate of start point

Y coordinate of start point

X coordinate of endpoint

Y coordinate of endpoint

Figure 27-1: Most CAD programs accept the DXF file format.

To create a DXF file, choose File Save As. Choose one of the DXF formats in the Files of Type drop-down list. You can save in DXF formats for Releases 12, 2000, and 2004. The 2005 format interchangeable with the 2004 format so that AutoCAD 2004 and AutoCAD LT 2004 can open AutoCAD 2005 and AutoCAD LT 2005 drawings, and vice versa. Click Save.

Exporting to other file formats

When you want to export a drawing to another file format, whether to create an image file or import that file into another application, you export the drawing. To export a drawing to another format (except for DWF, JPG, PNG, and TIF), follow these steps:

1.Choose File Export to open the Export Data dialog box, shown in Figure 27-2.

2.Choose the file format you want in the Files of Type drop-down list.

3.Find the desired folder using the Save In drop-down list and the Folder box.

4.Click Save.

840 Part V Organizing and Managing Drawings

Figure 27-2: The Export Data dialog box.

To export to JPG, PNG, or TIF formats, use the JPGOUT, PNGOUT, or TIFOUT command on the command line. Then, choose a folder, click Save, and select objects at the prompt.

Controlling the display of exported WMF files

The WMFBKGND system variable controls the background of WMF files that you export, whether using the Export dialog box, copying and pasting, or dragging and dropping. When the value of this system variable is Off (the default), the background color of the file is transparent, so that it doesn’t interfere with the background on which it is pasted. You can set it to On so that the background is the same as that of the drawing background.

The WMFFOREGND system variable works in tandem with the WMFBKGND system variable. It controls the foreground (line) color of objects when you export WMF files. WMFFOREGND takes effect only when you set WMFBKGND to 0, which makes the background color transparent. A value of 0, the default, swaps foreground and background colors, if necessary, to make the foreground color (the objects) darker than the background color. A value of 1 does the opposite — the foreground color is lighter than the background color.

On the

The drawing used in the following Step-by-Step exercise on exporting a WMF file,

CD-ROM

ab27-a.dwg, is in the Drawings folder on the CD-ROM.

Chapter 27 Working with Other Applications

841

STEP-BY-STEP: Exporting a WMF File

1.Open ab27-a.dwg from the CD-ROM.

2.Save the file as ab27-01.dwg in your AutoCAD Bible folder. You can see it in Figure 27-3.

Figure 27-3: The Easy Cotton Mills logo.

3.Choose File Export. The Files of Type drop-down list should say Metafile (*.wmf). The filename automatically reads ab27-01.wmf.

4.If necessary, locate your AutoCAD Bible folder. Click Save.

5.At the Select objects: prompt, make a window around the red rectangle to include all three objects. End object selection to end the command.

You’ve created a WMF file.

Importing files

For most file formats, choose Insert from the menu and then choose Raster Image or the file type you want to import. Find the file in the dialog box and click Open. In most cases, the command line then prompts you for an insertion point, X and Y scale factors, and a rotation angle, just as for block insertion.

Inserting a DXF file

If someone sends you a file in DXF format, it contains a drawing that was probably created in another CAD program. You can open that drawing in AutoCAD or AutoCAD LT. You can import a DXF file in two ways:

To import a DXF file into a new drawing, use the OPEN command to open a new drawing, choose DXF in the Files of Type drop-down list, choose the DXF file, and click Open.

To insert a DXF file into an existing drawing, choose Insert Block. In the Insert dialog box, click Browse. Then choose DXF in the Files of Type drop-down list, choose the DXF file, and click Open.

On the

The file used in the following Step-by-Step exercise on importing a WMF file, ab27-01.wmf,

CD-ROM

is in the Results folder on the CD-ROM. If you did the previous exercise, you can also find

 

the file in your AutoCAD Bible folder.

842 Part V Organizing and Managing Drawings

STEP-BY-STEP: Importing a WMF File

1.Open a new drawing using the acad.dwt or aclt.dwt template.

2.Save the file as ab27-02.dwg in your AutoCAD Bible folder.

3.Choose Insert Windows Metafile.

4.If you did the previous exercise, locate your AutoCAD Bible folder in the Import WMF dialog box. Choose ab27-01.wmf. If you didn’t do the previous exercise, find ab27-01.wmf in the Results folder of the CD-ROM. In the Import WMF dialog box, choose Tools Options. Check Wire Frame (No Fills), uncheck Wide Lines if necessary, and click OK. Click Open.

5.At the Specify insertion point or [Scale/X/Y/Z/Pscale/PX/PY/PZ/Protate]: prompt, pick any point near the top of your screen. Notice that the insertion point is at the top-left corner of the image.

6.Press Enter to accept the defaults for X and Y scales and rotation angle. Notice that you’ve lost the solid fill in the logo. The red rectangle came in fine. Also, you may see an added rectangle around the extents of the image where the extents of the screen were when the WMF file was created.

7.Pick the image. Notice that everything is selected with one grip at the insertion point. Choose Explode from the Modify toolbar.

8.Choose Tools Inquiry List and pick any part of the logo. Press Enter. Notice from the listing that the logo is now made up of polylines. Repeat the LIST command with the text. It has been converted to a TEXT object. (If the text was based on a SHX font, it would be converted to polylines.) Because WMF files convert to drawing objects, you can edit them, but they may require a good deal of cleanup to attain a pleasing result.

9.Choose Insert Windows Metafile. Choose ab27-01.wmf. Click Options to open the Import Options (WMF In) dialog box, as shown in Figure 27-4. This time, check Wide Lines, uncheck Wire Frame, and click OK. In the Import WMF dialog box, click Open to import the file. Pick in a different location in your drawing, and accept the defaults.

10.Explode the inserted image. (You may have to pick it at its edge.) Erase the rectangle and the line at the right that remains. Now you have an image that is very close to the original. The text comes in with the Bookman Old Style font (or the font you used — the same font as the original), although the spacing is not exact. Also, the logo now has its solid fill. It should look like Figure 27-4.

11.Save your drawing.

Figure 27-4: An imported WMF file.