In this video, author Shaun Bryant demonstrates how to manage block attributes in AutoCAD blocks.
- [Instructor] We're starting another drawing now called Reusing_ATTRIBUTES.dwg. Now, in the previous video we looked at creating a simple AutoCAD block called a sleeve and that was going to sit on top of a shaft in a mechanical assembly. Now, we've got the same sleeve ready to be turned into a block here but you'll notice that we've got a piece of text next to it that says SL_NAME, sleeve name. Now, that is an attribute. Now, let's have a look at that.
If I hover over that, you'll see that it's an attribute definition and again, it's on layer zero. When you're creating AutoCAD blocks you can assign attributes to those blocks which gives information about the block, so in this case it's the sleeve name, so it might have a specific name in the mechanical assembly that it's going into. Now, you'll notice that the current layer again is sleeve and when we turn this into a block, it'll adopt that current layer like it did in the previous video. Before we do that though, let's add another attribute definition to the block before we convert it all into a block.
So, to do that we need to be on layer zero first of all, so we will need to change our layer initially. We're then going to go to the Insert tab on the ribbon and you'll see here that we've got Define Attributes in the Block Definition panel, so I click on Define Attributes and you can see that there's various bits of information that we need to use here. So, we could have an invisible attribute which doesn't show on the drawing when you insert the block. You've got things like constant attributes that won't change, verify attributes where you have to verify the information and so on, so there's lots of different settings you can use.
All I want to do is lock the position of the attribute next to the block, next to the sleeve and we're going to specify the insertion point on screen. Now, the tag itself is going to be the sleeve number, so I'm going to put SL_NO, sleeve number and then the prompt here when you're prompted to put the attribute in will be sleeve number like that and the default there, we might put something like SL_NO. Now, that's just text that is a default value for the attribute tag.
Bear in mind, attribute tags cannot have spaces by the way as well. So, justification, we're going to go to the left. We've got a textile already built into the drawing called Attributes that we're using. Text height will be 10, rotation zero. So, as soon as I click on OK now, you'll see there's my attribute definition. Now, I want it to line up with this one, so how do I get it to line up? Well, what we'll do is we'll do a shift and a right click and we'll go Insert and then we'll just hover over that insertion point and we can specify it there on top of that one, so if I do that, we can specify on top of that one or I could line it in if I want to, so I could for example use something like object snap tracking, I could use a sacrificial line that I then delete before I create the block.
What I am going to do is I'm just going to hover over that insertion point there and click. Now, that puts it on top of the other attribute but then what I can do is I can select it there, click on the grip and just drag that up using the polar tracking and I know that that lines up nice and neatly and it's all left justified, so I'm just going to drag that up a little bit there. It doesn't matter what distance. I'll just hit escape to deselect it. So, I've now got my sleeve with my outline and my dash lines and my two attributes ready to be converted into a block, so I go back to the Home tab, make sure that you change that layer back to sleeve so that it adopts the current drafting layer.
Remember, all blocks created on layer zero adopt that current drafting layer. So, now I can go back to the Block panel here on the Home tab on the ribbon, click on Create Block and I'll just type in here, I'll give it the same name as the previous video, Sleeve like so and I'm going to pick the point where I want the sleeve to be inserted, so I'll use the same point as before, that midpoint snap there. I'll select the objects like we did in the previous video but make sure you also include the attribute definitions. Enter to confirm, so we should now have five objects, so we've got the rectangle, the two dash lines and the two attributes.
It doesn't have to be annotative. We will scale uniformly and we will allow exploding and what we might do there is put mechanical sleeve in the description again. So, there's our mechanical sleeve description as well. I'll click on OK and you'll see now as soon as I click on OK, it's prompting me now for the attributes, so I'm going to put the sleeve number in, so we'll say it's SL_256 just for argument's sake and the sleeve name might be SL_TOP, so we'll underscore that and we'll put top in there, something like that.
Again, don't worry too much about what the attribute values are. I'll click on OK and you'll see that those values come in. If you double click on the block now, you can edit those using the Enhanced Attribute Editor. Because it's a block, you can't edit its physical attributes but you can edit its block attributes, so you can see there that I can change the sleeve number, I can change the sleeve name. What I can also do is in the Text Options I might change the colors or the properties for example, so I can do that 'cause the color at the moment is by layer.
So, that's my tag for sleeve name. I change that to say red and I OK that, you'll see it goes red and you can differentiate it from the number of the sleeve perhaps or you might want the number of the sleeve to change, so you double click again, there's sleeve number, go to Properties, we'll make that say a blue color, so let's go for cyan for example, I OK that and now you can distinguish the two attributes from the block but they're still inside the block. So, as you can see, when you're reusing design content, you can create blocks and give those blocks information using your attribute definitions.
Note: The exam objectives are not release specific, but the course has been revised to reflect the most recent version of the software, AutoCAD 2018.
- What is AutoCAD certification?
- Drawing shapes and lines
- Creating isometric drawings
- Modifying objects
- Creating and using arrays
- Working with polylines and splines
- Organizing objects and layers
- Reusing content with blocks
- Annotating drawings with text, dimensions, multileaders, and tables
- Creating layouts
- Setting printing and plotting options