Wednesday, February 6, 2013

LESSON 2-6


LESSON 2-6




ATTRIBUTES

So far in using AutoCAD you have created geometry: lines, circles, etc. You have also added things such as text and dimensions. All of these things could also be done by hand, so what else does CAD have to offer?
As noted at the beginning of Level 1, AutoCAD is also a database of information. Most of that database contains the information for reproducing what you have drawn, but you can also add information that is non-graphical. One of the easiest ways of adding non-graphical information is to use attributes. An attribute is text that can be attached to a block to convey more information than just the geometry on its own could convey.
Look at the two drawings below for an example:
The first example shows some lines and arcs that could be anything.
The second example shows the same geometry with the attributes visible so that you see what the shapes represent.
Couch w/ Attributes
The pictures above show a couch. The attributes describe what the model number, color and cost are as well as the manufacturer. From this simple example, you can see that AutoCAD has a useful tool for showing more than just geometry.
This example shows information about furnishings in an office. Once you have drawn the floor plan, you could insert blocks of furniture that have information about the manufacturer, price, weight, and any other information you may need. This information can then be extracted out of AutoCAD and then used in a spreadsheet or other program which could generate a Bill of Materials. You can also use custom programs to use them in the CAD drawing.
In this lesson you will be creating attributes and attaching them to the computer block that you made previously. Like everything you do in AutoCAD, there are particular steps involved when you work with attributes.
  1. First you have to define (or create) the attribute.
  2. Next you will create the block with attributes.
  3. Finally, when you insert the block you will give it the specific information.
Many of the commands that you will be using are tough to remember at first. You may find it easier to use icons (but then the icons look very similar). Pull down menus are another option, so you can see exactly what the command is that you are starting.
Command
Keystroke
Icon
Menu
Result
Define an attribute
ATTDEF / ATT
Draw > Block >
Define Attribute
Creates an attribute definition
Edit attributes
DDATTE / ATE
<
Modify> Object> Attrb.> SingleEdits the contents of an existing attribute
Block
Block / Bmake / B
Draw > Block >
Make
Creates a block from separate entities and attributes.
Display Atts.
ATTDISP
None
NoneHides or shows attributes
Extract Attributes
EATTEXT
Tools > Attribute Extraction...Extracts attributes using the wizard
Open up the floor plans you drew earlier with the Computer blocks in Lesson 2-5.
Insert a computer block and then explode it (type X and then select the block - press .)
Begin the Attribute definition command: ATT (or) ATTDEF (or) DDATTDEF 
(AutoCAD has kept the commands from previous versions active in the new versions.)
Look at the dialog box below. Fill in the edit boxes just like the example. Make sure to adjust the text height if necessary.
What you did is give the attribute its definition - a name (tag), a prompt to help the user while they're inserting it, and a (default) value for the prompt. More Info.
Once everything is entered, select the OK button.
When you are back on the drawing screen, pick a point near the middle of the computer block. When you are done, the dialog box comes back so press OK.
Add the following attributes the same way, except instead of picking a point, check off theAlign below previous attribute checkbox.
TAG
PROMPT
VALUE
MONITORWhat is the MONITOR SIZE?XX"
HDDWhat capacity is the Hard Drive?X.XXGB
RAMHow much RAM is installed?XXXMB
STATIONWhat station is thisXXX

Once all the attributes are created you should have something like this:
Now create a block that includes your four attributes.
Selecting AttributesStart up the BLOCK command. Create it as shown in the previous lesson. When you are asked for the block name, give it the name COMP-AT.
Insert the block and you will get a dialog box where you can enter the values for the tags. You will be prompted to provide answers to the prompts that you defined in the attributes.
Command: I INSERT
Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
Enter attribute values
What is the CPU Speed 2.6 GHz
What is the monitor size 21"
What is the capacity of the Hard Drive 200Gb
How much ram is installed 1024Mb
 What station is this? 104Mb
After inserting the block and answering all the prompts, your block should look like this:
Now by looking at the drawing, you can see exactly what type of computer it is and what station (location) it is. This is just one application, but you can see how it can be used in any discipline of drafting. You can either insert more blocks, or copy the one that is in the drawing.
EDITING ATTRIBUTES: Of course, in any project, the data is subject to change. In this example, the company may decide that it cannot afford 24" monitors. You can easily change the value of attributes within a single block insertion by double-clicking on the block. That will bring up this dialog box:
Remember that this will only edit the one block that you double-clicked on. If you want to change more than one block at a time to SAME values, you can select the blocks, then right-click and choose properties.
DISPLAYING ATTRIBUTES: Sometimes you don't want to see the attribute values displayed (say for plotting). You can turn them off. This can be done by typing in the commandATTDISP and then OFF. To turn them back on again, type ATTDISP and ON. It can't get much easier.
EXTRACTING ATTRIBUTES: So now you're wondering what can you do with all of this information. A CAD drawing can be used to track inventory and export that data to another file for others to use. Maybe the purchasing department wants to know what to order, based on the design you are working on.
Exporting the data became MUCH easier in recent versions of AutoCAD.
Start up the EATTEXT command and you will see the wizard dialog box appear. Accept all the defaults and hit the Next button until you get to this step:
Note that all the attributes are checked - including ones you don't want. Uncheck the Nameproperty. Press Next.
The image above shows the wizard step which allows you to organize the data. You can click and drag the column headings to sort the order of the data. You can also sort a column by clicking on the column header. Continue through the wizard and place the table in your drawing. Note that you can update the attributes in your blocks (as shown above) and AutoCAD will prompt you to update your table in the communication centre in the bottom right corner of your screen.
Click on the Refresh Table Data text or right-click the table and choose the Update option. FOr more about tables in AutoCAD, please refer to lesson 4-9.
Start the Attribute Extraction dialog again (EATTEXT) and choose this option on step 4 to write the data to an external file instead of a table in the drawing.
Export to file
Continue through the wizard and save the data to a CSV file and finish.
You can view the data in Notepad, or a spreadsheet program like Excel (as shown below)
This is just a simple walkthrough of some of the power of AutoCAD. With more complex drawings and attributes, you can work wonders. Think about how easy it would be to build a table of all windows in a house plan if the windows were created as blocks with attributes. Some assembly drawings consist of nothing but standard blocks, this how much this simple process of creating attributes would help the workflow. Attributes are powerful - remember to use them.
Extra Practice: Here is an exercise for creating a title block with attributes. This is a handy item to have. It allows you to quickly enter the data for the title block using attributes, rather than create text every time.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.