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

Chapter 19 Referencing Other Drawings 553

If you have AutoCAD LT: If you did the previous exercise and opened ab19-05. dwg from your AutoCAD Bible folder, skip this step. If you opened ab19-05.dwg from the CD-ROM, you have opened an AutoCAD drawing with a clipped xref.

Because AutoCAD LT doesn’t support clipping, you need to re-attach the xref. Copy ab19-b.dwg from the \Drawings folder and ab19-01.dwg from the

\Results folder (both on the CD-ROM) to your AutoCAD Bible folder. Choose Insert Xref Manager. Choose ab19-01 and click Detach. Click Attach. Select ab19-01.dwg from your AutoCAD Bible folder and click Open. In the External Reference dialog box, uncheck the Insertion Point, Scale, and Rotation Specify On-screen check boxes (if checked) and click OK to attach the xref.

4.Choose Insert Xref Manager. Click the Tree View button. Choose ab19-b, the nested xref. Choose Unload and click OK to unload ab19-bs.

5.Repeat the XREF command. Choose ab19-b again. Choose Reload and click OK to reload the xref.

6.Repeat the XREF command again. This time choose ab19-01. Choose Bind. In the Bind Xrefs dialog box, choose Insert and click OK twice. This action inserts both xrefs (ab19-01 and ab19-b) as blocks. (Click the Layer Control drop-down list to see that there are no xref-type layer names.)

7.Save your drawing.

Summary

In this chapter, I covered the techniques you need to know to work with xrefs. You read about:

Attaching and overlaying xrefs

Opening an xref in its own window

Editing xrefs and blocks from within the drawing in which they appear

Clipping xrefs so that only the portion you need to see is displayed

Setting spatial and layer indexes to speed up the display of large xrefs

Deleting, unloading, and reloading xrefs

Binding an xref to make it part of your drawing

In the next chapter, I cover database connectivity, which enables you to access outside databases.

 

 

 

Working with External Databases

The AutoCAD database connectivity feature enables you to communicate with an external database from within AutoCAD.

AutoCAD LT does not include the database connectivity feature. This entire chapter applies to AutoCAD only.

Database connectivity is a powerful way to link drawing objects with data and is more flexible than using block attributes. With database connectivity, you can link data in an external database to any object in a drawing. In this chapter, I show you that database connectivity does not have to be as difficult as it often sounds.

Many AutoCAD users maintain databases separately from their drawings. Now you can work directly with your data by linking the rows of the database tables to objects in your drawings. The drawing objects thus become intelligent and carry these links with them in the drawing. You can also change data, such as a price or a part number, from within AutoCAD and have that change automatically applied and available in all drawing objects that are linked to that database item. Finally, you can create labels in your drawing, based on the data in the database.

Understanding External

Database Access

Many organizations maintain extensive databases of objects that are in your AutoCAD drawings. Manufacturers maintain databases of parts, offices maintain databases of furniture, and so on. You need to keep your drawings and the databases synchronized so that the information in the databases and in the drawings are always accurate and up-to-date.

20C H A P T E R

In This Chapter

Understanding database connectivity

Preparing for database connectivity

Connecting to a database

Linking data to drawing objects

Creating labels

Querying the database

Working with query files

556 Part III Working with Data

The linking of databases and AutoCAD drawings is referred to as external database access. External database access enables you to:

Create links between AutoCAD drawing objects and the external data

View data in external databases

Edit data in external databases

Display external database data in your drawing

The database connectivity feature works with the following databases:

Microsoft Access

dBASE

Microsoft Excel

Oracle

Paradox

Microsoft Visual FoxPro

SQL Server

After you configure a database, as explained later in this chapter, you can access the data in the database even if you don’t have the database program that created the data.

A database is a set of related information, usually maintained by a Database Management System (DBMS) — an application that manages databases. A database is stored in the form of a table that contains rows and columns. A row, also called a record, contains one element of data, such as the information for one desk. A column, also called a field, contains the attributes of the date, such as the price.

Table 20-1 shows the first three rows of the database used as an example in this chapter.

Table 20-1: A Simple Database Table

Part Number

Description

Dwg Size

Made/Purchased

Units

 

 

 

 

 

8665-023-012

Welding Wire — 0.030 StainlessB

B

P

FT

8665-023-013

Weld Rod — 0.045 Dia Stainless Steel

B

P

FT

8665-023-014

Welding — Rod 0.045 Dia S.S.

B

P

FT

 

 

 

 

 

A relational database is a type of database that contains a collection of tables. Each table represents a set of data for a defined use.

Structured Query Language (SQL — pronounced sequel or S-Q-L) was created to provide users with a database language that would be applicable across multiple platforms and databasemanagement programs.