Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 132 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
132
Dung lượng
1,69 MB
Nội dung
618 Part III ✦ Working with Data Summary In this chapter, I covered all the ways you can use blocks and attributes in your drawings. You read about: ✦ Combining objects into blocks in your drawings so that you can edit them as a unit ✦ Inserting blocks at any scale and rotation ✦ Saving a block as a file ✦ Copying objects by using the Windows clipboard and drag-and-drop ✦ Using the DesignCenter to import blocks from other drawings ✦ Utilizing attributes’ two main uses: to place text and to create simple databases ✦ Defining attributes ✦ Inserting blocks with attributes and assign values to the attributes ✦ Extracting attribute data In the next chapter, I explain how to insert references (xrefs) to other files into your drawings. ✦✦✦ Continued The figure shows a typical template file that tracks the company division, as well as the fur- niture’s manufacturer, purchase date, cost, and color. After you’re done, save the file with a file name extension of .txt. To use the file, you must use the ATTEXT command, which opens the Attribute Extraction dialog box. In this dialog box, click Template File and choose the file you created. Choose the file format you want to create and name the output file. Then click OK. AutoCAD extracts the attributes. 22 539922 ch18.qxd 5/2/03 9:39 AM Page 618 Referencing Other Drawings S ometimes you need to refer to another AutoCAD drawing without inserting it. You may want to use part of another drawing as an example for your current drawing or to see how the model in your drawing fits in with models in other draw- ings. Before AutoCAD offered external references, you had to print the other drawing to refer to it while in a current draw- ing or perhaps print both drawings and lay one on top of the other to compare them. Understanding External References External references (commonly called xrefs) enable you to view any drawing as a reference while in your current draw- ing. The external drawing is not part of your current drawing. The current drawing keeps track of the location and name of an external reference so you can always reference it easily. As with blocks, you can snap to objects in the external reference, thereby using it as a reference for the drawing process. You can also change the visibility settings of the xref’s layers. Xrefs have several advantages over blocks: ✦ Xrefs keep your drawing smaller than blocks. The exter- nally referenced drawing doesn’t become part of your drawing. Your drawing maintains only a reference (name and location) to the other drawing. ✦ You always have the most updated version of the xref. Each time AutoCAD loads your drawing, it loads the cur- rent copy of the xref. By contrast, you would need to reinsert a file inserted as a block to see the most updated version. 19 19 CHAPTER ✦✦✦✦ In This Chapter Understanding external references Attaching external references Editing external references from within your drawing Controlling the display of external references Managing external references ✦✦✦✦ 23 539922 ch19.qxd 5/2/03 9:39 AM Page 619 620 Part III ✦ Working with Data ✦ In a team project, several people can use the same drawing as an xref, each having access to the latest changes. ✦ You may not want the xref to be part of your drawing. If you are using only the xref for reference, you may detach it before plotting. Xrefs can be attached and detached easily for maximum flexibility or overlaid for temporary use. Attaching an external reference The first step is to attach the external reference, which is just another drawing, to your current (host) drawing. When working with xrefs, you may find it useful to use the Reference toolbar. To open the Reference toolbar, right-click any toolbar and choose Reference. To attach an xref, follow these steps: 1. Choose External Reference from the Reference toolbar (or choose Insert ➪ Xref Manager) to start the XREF command. AutoCAD opens the Xref Manager, shown in Figure 19-1, your one-stop shopping mall for external references. This dialog box enables you to manage all your xrefs in one place. If you don’t have any xrefs in use in a drawing, the External Reference dialog box is blank. If you do have xrefs in your drawing, this screen shows your cur- rent external references. 2. To attach an external reference, choose Attach in the Xref Manager to open the Select Reference File dialog box. Choose the file you want to attach and click Open. AutoCAD opens the External Reference dialog box, shown in Figure 19-2. The dialog box displays the file you chose along with its path (location). Figure 19-1: The Xref Manager 23 539922 ch19.qxd 5/2/03 9:39 AM Page 620 621 Chapter 19 ✦ Referencing Other Drawings Figure 19-2: The External Reference dialog box 3. Choose the type of xref in the Reference Type section: • Attachment: Use an attachment when you want to be sure that the xref will be displayed if someone else xrefs your current drawing., In other words, that person will see your current drawing and your xref will be nested within it. • Overlay: Use an overlay when you are sharing drawings in a networked environment and don’t want to change your drawing by attaching an xref. If someone else attaches your drawing while you are working on it, the overlay is not displayed. 4. From the Path Type drop-down list, choose the type of path you want to use: • Full path: Specifies the full path of the xref drawing, including the drive letter (such as c:.) • Relative path: Specifies only part of the xref drawing’s path, assuming the current drive or folder. This option enables you to move an xref to a different drive that has the same folder structure. • No path: Uses the current folder of the host drawing. This option enables you to move an xref to another folder with a different hierarchy. 5. Use the bottom half of the dialog box to specify the insertion point; X, Y, and Z scale factors; and rotation angle either in the dialog box or onscreen. These prompts are the same ones you use when inserting a block or file. 6. Click OK. AutoCAD attaches the xref. If your current view does not show the entire xref, do a ZOOM Extents. 23 539922 ch19.qxd 5/2/03 9:39 AM Page 621 622 Part III ✦ Working with Data After you have the xref in your drawing, you can start to work. The xref is like a block, but you cannot explode it. However, you can use object snaps on all the objects in an xref, just as you can with blocks. This enables you to use the xref as a basis for your own drawing. Opening an xref Sometimes you need to open the xref to work on it directly. You may see an error that you want to correct, for example. The XOPEN command, new for AutoCAD 2004, opens xrefs. The easiest way use XOPEN is to click the xref to select it in your drawing, right- click, and choose Open Xref. The xref opens in its own window. If you look in the Xref Manager, the xref’s status is listed as Open. You can also select the file in the Xref Manager and click Open. When you click OK to close the Xref Manager, the xref drawing opens. Viewing xref relationships To see what type of xrefs you have in your drawing, choose External Reference from the Reference toolbar or Insert ➪ Xref Manager. The external references are listed in the Xref Manager. You can choose one of two views: ✦ List View lists all the xrefs along with their status, size, type, date and time saved, and the saved path, if any. ✦ Tree View lists all the xrefs in a graphical view that shows their relation- ships. This view is great for understanding nested xrefs. You can change the width of the columns in List View by placing the cursor on a column dividing line until it changes to a two-headed arrow. Then drag in either direction. Click any xref, and the Xref Found At box displays the location of the xref. If the AutoCAD cannot find a drawing, it helps to know where it searches for xrefs. AutoCAD searches for xrefs according to a specific order: ✦ Path specified: To find the specified path xref ✦ Current folder: To find the current folder of the host drawing ✦ Project path: To check or change the project path, choose Tools➪ Options and click the Files tab. Double-click Project Files Search Path. Click Add and then click Browse to navigate to a folder where you keep drawings that you may want to use as xrefs. Tip New Feature 23 539922 ch19.qxd 5/2/03 9:39 AM Page 622 623 Chapter 19 ✦ Referencing Other Drawings ✦ Support path: To check or change the project path, choose Tools➪ Options and click the Files tab. Double-click Support File Search Path. Click Add and then click Browse to navigate to a folder ✦ Start-in folder: To find the start in folder, right-click your AutoCAD 2004 desk- top shortcut and choose Properties. The drawings used in the following Step-by-Step exercise on attaching xrefs, ab19-a.dwg and ab19-b.dwg, are in the Drawings folder of the AutoCAD 2004 Bible CD-ROM. Step-by-Step: Attaching Xrefs 1. Open ab19-a.dwg from the CD-ROM. This is the floor plan for a house. If the Reference toolbar is not displayed, right-click any toolbar and choose Reference. 2. Open Windows Explorer (right-click Start on the task bar and choose Explore). Copy ab19-b.dwg from the CD-ROM to your AutoCAD Bible folder. 3. In AutoCAD, choose External Reference Attach from the Reference toolbar. In the Select Reference File dialog box, choose ab19-b.dwg. Choose Open. 4. In the External Reference dialog box, you see the file name displayed. Make sure all Specify On-screen check boxes are unchecked and click OK. AutoCAD displays ab19-b.dwg, which is a title block, in ab19-a.dwg. 5. Save the drawing as ab19-01.dwg in your AutoCAD Bible folder. Click the drawing’s Close box to close the drawing. 6. Start a new drawing using the acad.dwt template. Choose Format ➪ Units and choose Architectural. In the Units to Scale Drag-and-Drop Content drop- down list, choose Inches. Choose OK. Save it as ab19-02.dwg in your AutoCAD Bible folder. 7. Choose External Reference Attach from the Reference toolbar. In the Select Reference File dialog box, choose ab19-01.dwg, which you just saved in your AutoCAD Bible folder. Choose Open. 8. In the External Reference dialog box, you see the file name displayed. Leave the other defaults and click OK. Choose Zoom Extents from the Zoom flyout on the Standard toolbar. AutoCAD displays ab19-1.dwg, which includes both the title block and the floor plan of the house in your new drawing. The title block drawing ( ab19-b.dwg) is a nested xref in the floor plan (ab19-1.dwg) xref. AutoCAD tells you this with the following message (press F2 to open the AutoCAD Text Window so you can see the message that scrolls by): Attach Xref “ab19-1”: C:\AutoCAD Bible\ab19-1.dwg “ab19-1” loaded. Attach Xref “ab19-b”: C:\AutoCAD Bible\ab19-b.dwg “ab19-b” loaded. On the CD-ROM 23 539922 ch19.qxd 5/2/03 9:39 AM Page 623 624 Part III ✦ Working with Data 9. To help you visualize the relationships among the three drawings, choose External Reference from the Reference toolbar. The Xref Manager lists both drawings. Click Tree View at the top of the dialog box. AutoCAD now lists the two xrefs in a tree structure, showing their relationship more clearly, as shown in Figure 19-3. Click Cancel. Figure 19-3: Tree view shows nested xrefs clearly. 10. Save your drawing. It should look like Figure 19-4. Figure 19-4: The current drawing is blank but displays an xref of a house plan that has a nested xref of a title block. 23 539922 ch19.qxd 5/2/03 9:39 AM Page 624 625 Chapter 19 ✦ Referencing Other Drawings Editing an Xref within Your Drawing While you are working in a drawing with an external reference you may decide that the external reference needs some modification. The same may apply if you inserted a file as a block. Since AutoCAD 2001i, you can make changes to the xref or block and save those changes back to the original drawing. You can even transfer objects from your drawing to the xref or block and vice versa. AutoCAD calls this in-place editing. The steps to edit an xref or block are as follows: 1. Choose the xref or block in your drawing. 2. Choose from any nested xrefs. 3. Select the objects you want to edit to add them to the working set of objects being edited. 4. Edit the objects. 5. If desired, add or remove objects from the working set to transfer them to or from the xref or block. 6. Save the changes back to the xref or block. Choosing the xref or block to edit To start the process of in-place editing, double-click the xref you want to edit. AutoCAD opens the Reference Edit dialog box, shown in Figure 19-5. You can also choose Modify ➪ Xref and Block Editing ➪ Edit Reference In-Place and then select the xref you want to edit. Figure 19-5: The Reference Edit dialog box enables you to choose which reference you want to edit, including nested references. 23 539922 ch19.qxd 5/2/03 9:39 AM Page 625 626 Part III ✦ Working with Data As you click each of the available references, its preview appears at the right. You can click Next to cycle through the references. If the xref has nested objects, choose one of the following options (if not, ignore this section of the dialog box): ✦ Automatically select all nested objects: Includes all nested objects in the editing ✦ Prompt to select nested objects: Prompts you to select the nested objects you want to edit For more control, click the Settings tab to set the following options: ✦ Create unique layer, style, and block names: Displays layer, style, and block names with a prefix of $#$, to help distinguish them from these named items in your main drawing. ✦ Display attribute definitions for editing: Enables you to edit attribute defini- tions of blocks with attributes. (See Chapter 18 for details on attributes.) ✦ Lock objects not in working set: Locks objects in the host drawing so that you can’t accidentally modify them Click OK to close the Reference Edit dialog box. If the references come from an earlier release, AutoCAD warns you that if you save your changes back to the xref, that xref will be updated to an AutoCAD2004 drawing. If you checked the Prompt to select nested objects item, AutoCAD prompts you to select nested objects. Complete object selection to define the working set — the objects you can edit. Other objects are faded by 50 percent (the default, deter- mined by the XFADECTL system variable). AutoCAD displays the Refedit toolbar, shown in Figure 19-6, and the message Use REFCLOSE or the Refedit toolbar to end reference editing session. You are now ready to edit the xref or block. Note 23 539922 ch19.qxd 5/2/03 9:39 AM Page 626 627 Chapter 19 ✦ Referencing Other Drawings Figure 19-6: The Refedit toolbar Editing the xref There are several types of edits you can make on the working set of objects from the xref or block: ✦ If you change an object’s properties, such as its layer, the object will have the new object property. ✦ If you erase an object, the object is deleted from the xref or block. ✦ If you draw a new object, the object is added to the xref or block. An excep- tion is if you create a new object by editing objects outside the working set. For example, if you break a line (not in the working set) into two lines, nothing is added to the working set. ✦ You can transfer an object from the main drawing to the xref or block. Select an object and choose Add objects to working set. Remember that the working set consists of objects from the xref or block, so if you add objects to the working set, they become part of the xref or block. ✦ You can transfer an object from the xref or block to the main drawing. Select an object and choose Remove objects from working set. The working set consists of objects from the xref or block, so if you remove objects from the working set, they are no longer part of the xref or block; instead, they become part of your main drawing. After you finish editing the working set, if you like what you did, choose Save back changes to reference from the Refedit toolbar. If not, choose Discard changes to reference . When you save changes to a block, block definitions are redefined and all instances of the block are regenerated according to the new definition. If you gave an xref object properties that don’t exist in the xref, such as a layer, AutoCAD copies the new property to the xref so that the object can keep that property. Edit block or Xref Add object to Refedit working set Discard changes to reference Remove objects from the Refedit working set Save back changes to reference 23 539922 ch19.qxd 5/2/03 9:39 AM Page 627 [...]... Cancel 63 5 23 539922 ch19.qxd 63 6 5/2/03 9:39 AM Page 63 6 Part III ✦ Working with Data 3 Choose Save from the Standard toolbar Note the message on the command line that AutoCAD is updating the indexes 4 Close ab19-01.dwg 5 Open ab19-02.dwg from your AutoCAD Bible folder This drawing has an attached xref of a house plan and a nested xref of a title block, as shown in Figure 19-11 1 2 0 3 4 9 6 8 5 7... in your AutoCAD Bible folder Click the Close box of ab19-04.dwg to close the drawing (but not AutoCAD) , leaving ab19-03.dwg on your screen 3 Choose Insert ➪ External Reference and choose ab19-04.dwg from the AutoCAD Bible folder Click Open From the External Reference dialog box, uncheck all the Specify On-screen checkboxes and click OK AutoCAD inserts the xref 4 Double-click the title block AutoCAD. .. of the AutoCAD 2004 Bible CD-ROM Step-by-Step: Controlling Xref Display 1 Open ab19-01.dwg from your AutoCAD Bible folder if you did the first exercise in this chapter If you didn’t do the previous exercise, first use Windows Explorer to find ab19-b.dwg in the Drawings folder of the CD-ROM and ab19-01.dwg and ab19-02.dwg in the Results folder on the CD-ROM Copy all three files to your AutoCAD Bible. ..23 539922 ch19.qxd 62 8 5/2/03 9:39 AM Page 62 8 Part III ✦ Working with Data On the CD-ROM The drawings used in the following Step-by-Step exercise on editing an xref in place, ab19-a.dwg and ab19-b.dwg, are in the Drawings folder of the AutoCAD 2004 Bible CD-ROM Step-by-Step: Editing an Xref in Place 1 Open ab19-a.dwg from the CD-ROM Save it as ab19-03.dwg in your AutoCAD Bible folder 2 Open ab19-b.dwg... Chapter 26 for full coverage of the Reference Manager On the CD-ROM The drawing used in the following Step-by-Step exercise on managing xrefs, ab19-05.dwg, is in the Results folder of the AutoCAD 2004 Bible CD-ROM 23 539922 ch19.qxd 5/2/03 9:39 AM Page 64 1 Chapter 19 ✦ Referencing Other Drawings Figure 19-15: An xref log file Step-by-Step: Managing Xrefs 1 Use ab19-5.dwg from your AutoCAD Bible folder... this chapter Table 20-1 A Simple Database Table Part Number Description Dwg Size Made/Purchased Units 866 5-023-012 Welding Wire — 0.030 StainlessB B P FT Weld Rod — 0.045 Dia Stainless Steel B P FT Welding — Rod 0.045 Dia S.S B P FT 866 5-023-013 866 5-023-014 24 539922 ch20.qxd 5/2/03 9:39 AM Page 64 5 Chapter 20 ✦ Working with External Databases A relational database is a type of database that contains... system 64 5 24 539922 ch20.qxd 64 6 5/2/03 9:39 AM Page 64 6 Part III ✦ Working with Data 8 Connect to your data source 9 Open the Data View window containing your data table 10 Edit the data, if desired 11 Link database rows to objects in your drawing 12 Create labels based on your data in your drawing, if desired Installing AutoCAD s database feature Database connectivity is not part of the Typical AutoCAD. .. 9:39 AM Page 64 7 Chapter 20 ✦ Working with External Databases On the CD-ROM The file used in the following Step-by-Step exercise on creating the structure for the database, ab20-prt.mdb, is in the Drawings folder of the AutoCAD 2004 Bible CD-ROM Step-by-Step: Creating the Structure for the Database 1 Right-click Start on the task bar Choose Explore to open Windows Explorer 2 If your AutoCAD Bible folder... window, click the plus sign (+) next to the drive containing the AutoCAD Bible folder 3 Click the AutoCAD Bible folder and choose File ➪ New ➪ Folder from the Explorer menu A new folder appears in the right window, called New Folder Type Databases ↵ to rename the folder 4 If necessary, in the Folders window, click the plus sign to open the AutoCAD Bible folder You should see the new Databases folder (If not,... box, type ab20-Access 5 Click Select and navigate to your \AutoCAD Bible\ Databases folder (which you created in the previous exercise) Choose ab20-prt.mdb and click OK 6 Click OK twice more to exit the ODBC Data Source Administrator 7 Close the Control Panel 8 Open AutoCAD Open ab20-a.dwg from the CD-ROM Save it as ab20-01.dwg in your AutoCAD Bible folder 9 Choose Tools ➪ dbConnect to open the dbConnect . ab19-02.dwg, are in the Drawings folder of the AutoCAD 2004 Bible CD-ROM. Step-by-Step: Controlling Xref Display 1. Open ab19-01.dwg from your AutoCAD Bible folder if you did the first exer- cise. OK. AutoCAD displays ab19-b.dwg, which is a title block, in ab19-a.dwg. 5. Save the drawing as ab19-01.dwg in your AutoCAD Bible folder. Click the drawing’s Close box to close the drawing. 6. . your AutoCAD Bible folder. 7. Choose External Reference Attach from the Reference toolbar. In the Select Reference File dialog box, choose ab19-01.dwg, which you just saved in your AutoCAD Bible