Visibility parameter

The Door block we made in the previous example now has many parameters and actions and with that it now has many properties, but we can add even more properties to that Door block using the visibility parameter. In the next example, we will add the visibility parameter to the Door block.

Figure 9.46: Doors with different open angles 

In the following example, I will make another Door dynamic block with open angles of 0, 30, and 90 degrees. To do this, make three doors, as shown in Figure 9.46:

  1. Click the Create Block option in the Block panel of the Home tab to start the Block Definition command, or use the command alias B to start this command.
  2. Name the block 0 angle. Click the Pick point box and specify the point marked in Figure 9.47 as the base point:
Figure 9.47: Basepoint highlighted in the red circle of the 0 angle block 
  1. Click Select objects and then select all the objects that make the 0-degree open-angle block, as shown in Figure 9.47, and then press Enter.
  2. Uncheck the Annotative, Scale uniformly, and Open in block editor checkboxes, and check the Allow exploding box. The final Block Definition window should look like this:

Figure 9.48: The Block Definition window with all the settings in it 
  1. Click OK when you are done making these changes. Now, we have a simple block in the drawing area called 0 angle.
  2. Repeat the process and make two more blocks, called 30 angle and 90 angle, and similar block definition parameters. Also, make sure that you select the same base point as we did in Figure 9.47 in other blocks too.

This was the first step toward making a dynamic block with a visibility parameter. In this case, we made three separate blocks, and now we will use all these blocks in our dynamic block:

  1. Place all the blocks overlapping one another in such a way that the base points of all three blocks overlap, as shown in Figure 9.49:

Figure 9.49: All blocks placed over one another with overlapping base points as shown in the red circle 
  1. Once again, start the Create block command from the Block panel of the Home tab, or use the command alias B.
  2. Give this block a name. For this example, I will name it Door Vis, short for Door Visibility.
  3. Click the Pick point box and select the common base point of the blocks as the pick point.
  4. Click the Select objects box and select all three Door blocks from the drawing area. Press Enter.
  1. Uncheck the Annotative and Scale uniformly options, and check the Allow exploding and Open in block editor checkboxes, as shown in Figure 9.50:

Figure 9.50: Settings in the Block Definition window for the Door Vis block 
  1. Click OK in the Block Definition window, and the Door Vis block will open in the Block Editor.

Now we have a set of blocks in the Block Editor. We will add a visibility parameter and action to the set of blocks so that only one of the blocks remains visible in each visibility parameter:

  1. From the BLOCK AUTHORING PALETTE of the Block Editor environment, select the Visibility parameter from the Parameters tab, as shown in Figure 9.51:

Figure 9.51: The Visibility parameter on the Parameters tab 
  1. Click on any point close to the set of blocks to place the Visibility parameter. For this example, I clicked close to the top-right point of the Door block.
  2. A Visibility1 parameter with an exclamation mark will be added. Now, we need to add actions to make this parameter work.
  3. Click the Visibility States option under the Visibility panel of the Block Editor tab, as shown in Figure 9.52:

Figure 9.50: Visibility States option under the Visibility panel of the Block Editor tab 
  1. Click the New button and then give this new visibility state a name. For this example, name it 30-angle and click the OK button. Repeat the process and add one more visibility state called 90-angle.
  2. Now, the Visibility States window should have three Visibility States, as shown in Figure 9.53. Click OK when you are done adding all three Visibility States:

Figure 9.53: Three Visibility States added in the Visibility States window 
  1. Now, select 0-angle from the visibility drop-down menu of the Visibility panel, and then click the Make Invisible option from the Visibility panel, as shown in Figure 9.54. Click the 30-degree and 90-degree blocks from the Block Editor drawing area (leave the 0-degree block) and press Enter:

Figure 9.54: The Make Invisible option on the Visibility panel with the 0-angle state selected 
  1. You will notice that the 30-degree and 90-degree blocks will disappear from the drawing area of the Block Editor, and for the 0-angle visibility state, only the 0-degree block will remain visible.
  2. Once again, in the Visibility parameter drop-down menu in the Visibility panel, select the 30-angle parameter and then click the Make Invisible icon, as shown in Figure 9.54.
  3. All three blocks will again appear. Now, click the 0-degree and 90-degree blocks from the drawing area of Block Editor and press Enter.
  4. Again, select the 90-degree visibility parameter from the dropdown and, in this case, make the 0-degree and 30-degree blocks invisible using the same steps we have followed so far.
  5. When you are done applying these visibility actions, click Close Block Editor at the end of the Block Editor tab and save the changes in this block.
  6. The block will now appear in the model space, and when you select it, a down arrow grip will appear next to the block. Click on it, and you will get a list of the Visibility States we have applied to this block.
  7. Select 0-angle and the block will change to the 0-angle block. Similarly, if you select the 30-angle and 90-angle blocks, the block will change to the respective angle Door block, as shown in Figure 9.55:

Figure 9.55: Visibility parameter making only one of the blocks visible

So, this was an example of the visibility parameter and action tool of dynamic blocks. As you can see, there are lots of other parameters and actions available in the BLOCK AUTHORING PALETTE, and I encourage you to explore them too.

Now we have finished the drawing and editing part of 2D drawing in AutoCAD. Before we move on to the 3D drawings, let's learn a little bit about managing drawing files and keeping them clean in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.214.32