As you learned in the previous article of the series, you can assign the Label Block for Views property in your sheet set so that it automatically inserts a label block when you create a view from the Model Views. While you can manually edit the values for the block data, such as viewport scale, view title, and view number, wouldn’t it be great if that process was automated? It can be! Here’s how you can automate view label data in AutoCAD.
Assuming you’ve already assigned the Label Block for Views property in the Sheet Set Properties according to the previous step, you can simply replace the default attribute values with the appropriate Fields. If your label block does not contain attribute definitions, you can define block attributes using traditional methods and then follow this procedure.
1. Open the drawing containing the source block definition. This is the drawing which is being used by the Label Block for Views in the Sheet Set Properties. It is very important that you make sure you are editing the block definition which is being used by the sheet set. You might have several versions of a block and if you are editing one version, but testing a different version, you will make yourself crazy trying to troubleshoot! The time you take verifying that the exact path and the file name being used by the sheet set matches the one you are editing will be worth it.
You will need to edit the Default value for each of the attribute definitions. A typical view label block would include attribute definitions for the view number, name, and scale. Your block might include additional information as well, but these three are the most common. The method you use to update the attribute definition depends somewhat on whether the block is stored as its own drawing or as a block definition within a drawing.
You want to ensure that you are editing the attribute definition, NOT the attribute value in the block instance. How can you tell the difference? The attribute definition says “Default,” whereas the attribute value says “Value.” If you insert a field in an attribute “Value,” it may appear to work properly. But if the instance was updated to include a field and the definition was not, the next time someone erases the block instance and reinserts it, the field data will no longer be there.
2. If your label block is stored as its own drawing, go to the next step. If your label block is stored as a block definition within your drawing, insert and explode the label block (alternate methods include Battman or the Block Editor). 2. If your label block is stored as its own drawing, go to the next step. If your label block is stored as a block definition within your drawing, insert and explode the label block (alternate methods include Battman or the Block Editor). When you explode a block with attributes, the attribute values (left) are replaced with the attribute definitions (right).
3. Double-click on the attribute definition for the view number.
4. In the Edit Attribute Definition dialog box, right-click in Default and select Insert Field.
5. In the Field dialog box, select the SheetSet Field category, the SheetSetPlaceholder Field name, the ViewNumber Placeholder type, and an appropriate format. Then choose OK.
6. Select the attribute definition that you just edited, right-click and choose Properties.
7. In the Properties window, set the Preset property to Yes. Since the Field will be entering the attribute value for you, you do not want to prompt the user to enter the information as you would have done using traditional attribute definitions. Setting the Preset property to Yes will prevent AutoCAD from asking for a value when the block is inserted.
8. Repeat steps 3-7 to add fields to each of the attribute definitions by selecting the appropriate Field name. For example, use ViewTitle to display the name of the view and use ViewportScale to display its scale.
9. Redefine the view label block using the Block command (not necessary if you use BATTMAN or the Block Editor) and save the drawing. Keep in mind that the insertion point you specify will determine how the block is inserted relative to the viewport as described in the previous step.
That’s all it takes to make your old view label block smarter! Now you can try it out by creating a new sheet and then dragging a view from the Model Views tab onto the sheet. The view label should automatically display the viewport scale and view title. By default, the view title uses the name of the named model space view or the drawing depending which one you inserted from the Model Views tab. There is no default number associated with the view, but you can easily change the view number and the view title in the Sheet Set Manager using the Sheet Views tab.
1. In the Sheet Set Manager, select the Sheet List tab.
2. Right-click and choose New Sheet. When creating and testing sheet set fields, always create a new sheet to ensure that you are using the appropriate (new) definitions. If you add a new view to an existing sheet which already contains your old view label block definition, it will use that definition rather than the one you updated in the source file and you’ll spend all your time trying to “fix” a problem that doesn’t exist.
3. Open the new sheet.
4. Select the Model Views tab and drag a view or drawing onto your sheet. When you add a new view to your sheet, that new view will automatically display on the Sheet Views tab.
5. Select the Sheet Views tab. This tab displays all of the sheet/layout views created by the Sheet Set Manager. You can display the view list by sheet or by view category.
6. Right-click on the newly created view and choose Rename & Renumber.
7. In the Rename & Renumber dialog box, you can enter a view number and/or change the view title and then choose OK. The field value in the view label block will update the next time the drawing regenerates (i.e., during an Open, Save, Plot, etc.) or you can use the REGEN command to force a regeneration.
Now that your drawing is using field data, it is CRUCIAL that you do not edit those attribute values using traditional methods. For example, if you want to change the view title, it might be tempting to double-click on the inserted view label block and enter the new title. If you do that, you’ve replaced the dynamic field data with static old text and the intelligence you gained from fields is gone. Unfortunately there is no way to prevent users from making this mistake so it can only be avoided through education. If you see a field in a drawing (text with a grey background), never edit it! That data is being read from somewhere else and you need to edit the source, not the attribute value. In most cases that source data must be edited in the Sheet Set Manager.
What’s Next?
In the next article, we’ll explore how to automate callout data. Remember, you can always catch up on the entire Mastering AutoCAD Sheet Sets series!