Название: AutoCAD Platform Customization
Автор: Ambrosius Lee
Издательство: Автор
Жанр: Зарубежная образовательная литература
isbn: 9781118798911
isbn:
You can rename nongraphical objects using the dialog box that you used to originally create the object, or you can use the rename command. The rename command displays the Rename dialog box. If you are updating your existing CAD standards or moving to a new set of standards, you can use the – rename command in a script file or custom program to automate in a single operation the process of renaming several nongraphical objects in the drawings that have already been created. I discuss scripts in Chapter 8, “Automating Repetitive Tasks.”
Use the following steps to rename a nongraphical object in an existing drawing:
1. Do one of the following:
• At the command prompt, enter rename and press Enter (Windows and Mac OS).
• Click Format menu ➢ Rename (Mac OS).
2. When the Rename dialog box (see Figure 2.2) opens, select the type of object you want to rename from the Named Objects list.
3. From the Items list, select the object you want to rename.
4. Do one of the following
• In the Rename To text box, enter the new name for the object and click Rename To (Windows).
• Select the object a second time to display the in-place text editor, and enter the new name for the object (Mac OS).
5. Repeat steps 2–5 for each object you want to rename.
6. Click OK when you have finished renaming objects.
Figure 2.2 Renaming nongraphical objects
Managing Object Properties with Layers
Objects in a drawing have a number of properties in common with each other: color, linetype, lineweight, and several others. These are often referred to as an object's general properties. You can modify these properties individually using the Properties palette (Windows) or Properties Inspector (Mac OS) or let an object inherit values based on the layer in which it is placed.
I recommend allowing objects to inherit their properties from the layer in which they are placed; it is much easier to modify a single layer than it is to modify several thousands of objects. In addition, layers make it much simpler to control the visibility, locking, and plotting state of all related objects on a layer. An object's general properties must be set to ByLayer to allow it to inherit the property values of the layer it is on. Setting an object's property value directly overrides the layer's property value, which could have undesired effects when plotting or printing a drawing.
Layers are commonly created using the layer command. As a rule of thumb, don't allow individual users to create their own layers in each drawing, as doing so can introduce the following:
• Errors against the established CAD standards; the wrong layer name or incorrect property values
• Inefficiencies in your processes because of the amount of time it takes to define each layer that is needed
You can add all your commonly used layers to drawing template files so they are ready for use when the drawing is created. However, if a layer is not used it can inadvertently be purged from a drawing with the purge command. If a layer that was purged is needed later in the project, that layer will need to be re-created manually, inserted as a block that contains the missing layers, or re-created using an automated process. One of the simplest solutions to restoring standard layers that were purged from a drawing is to maintain a drawing file that contains the same layers as those in your drawing template files. Then, you can insert the drawing file with the insert command; all previously purged layers that were part of your drawing template file are restored and the layers that exist in both drawings are ignored.
In addition to adding your layers to a drawing template, consider using the – layer command in a script file or custom program to create the layers you need in a drawing. This approach has two benefits: you can use the script or program to create the layers in your drawing template file, and you can use it to reset the properties of layers if someone changes their values to be different from your CAD standards.
Setting the Default Properties for New Objects
When new objects in a drawing are created, they take on not only the current layer, but also a number of other values that are typically set to the value ByLayer or 0.0000. You can adjust these properties in the General section of the Properties palette (Windows) or Properties Inspector (Mac OS) when no object is currently selected. You can also use the ribbon controls in AutoCAD on Windows. As an alternative, the system variables listed in Table 2.1 can be used to control the default property values assigned to new objects that are created with a command.
Table 2.1 System variables used to set default property values
These system variables are helpful if you decide to create scripts or custom programs that create new objects or perform drawing setup tasks. I cover scripts in Chapter 8.
In most cases, you want to make sure that these variables are set to ByLayer or the equivalent value to make sure your new objects inherit the properties from the layer they are placed on. You can use the setbylayer command to reset an object's properties to ByLayer.
Creating and Managing Layers
You typically use the Layer Properties Manager (Windows) or Layers palette (Mac OS) to create new layers and edit existing ones in a drawing. When one of the interfaces is displayed, you click the Create New Layer (Windows) or New Layer (Mac OS) button and then set the properties in the Layers list for the new layer. Editing a layer is similar to the steps you take when creating a layer, except that you just need to click on the layer's row and in one of the properties on that row to begin editing the layer.
Follow these steps to create a new layer in AutoCAD on Windows:
1. On the ribbon, click Home tab ➢ Layers panel ➢ Layer Properties (or at the command prompt, enter layer and press Enter).
2. When the Layer Properties Manager (see Figure 2.3, top) opens, click Create New Layer.
TIP
If a layer already exists with the property values close to the new layer you want to create, select the layer that you want to base the new layer on and then click Create New Layer.
3. Enter a name that follows your company's established CAD standards.
4. In the new layer's row, click one of the columns that represents the properties of the layer. The following explains what to do after clicking on the column:
• On: Toggles the layer on or off. When set to Off, objects on the layer can still be selected using the All keyword at the Select objects: prompt, and the objects are regenerated when the drawing's display is updated.
• Freeze: Toggles the freeze and thaw states of the layer. When set to Freeze, objects on the layer can't be selected using the All keyword at the Select objects: prompt, and the objects aren't regenerated when the drawing's display is updated.
СКАЧАТЬ