A parametric block is a type of block with special properties that, when adjusted, transform the geometry or presentation of the annotation or symbology represented. Akin to dynamic blocks in AutoCAD, parametric blocks take fewer steps to set up. The benefit of setting up parametric blocks is having one symbol that can adapt to varying displays without having to explode it to make it work.
In Part 1 of this blog, we looked at adding a stretch parameter to a section cut block. Then in Part 2, we added a reference curve parameter. In Part 3, we added two parameters that caused the block to mirror along predefined axes. Today, to wrap up our discussion of parametric blocks we will look at adding visibility parameters which enable us to make the block look different under certain conditions or standards. We will alter the block to display the section cut with or without a page number reference.
- Open the block in Block Editor.
- From the Blocks panel of the 2D Parametric ribbon tab, click the bottom half of the Blocks button to display its options. Then click Visibility.
- The Visibility States panel opens on the left edge of the application window. Click the plus icon on the lower right edge to add a visibility state.
- A parameter is entered in the panel. Give this parameter a meaningful name. Then click Add State.
- Give the state a name. In this example, the state With was created to represent the block displaying a sheet number. Create another state called Without to represent the opposite. Then click the arrow to the right of With to continue.
- The panel changes its appearance and indicates that there are no entities linked to this state. Before going any further, we must ensure that all entities are created that will exist in the different states.
• The With state will contain the original attributes and the horizontal line that is dividing the circle in half.
• The Without state will contain a copy of the attribute representing the section number which will be centered in the circle. - After creating a copy of the attribute, the Block Editor will look like this:
- To add the entities to be displayed in the With state, click the plus sign in the lower right corner of the panel.
- For this example, we will select the top section number attribute and the section sheet attribute as well as the horizontal line that is dividing the circle in half. These are the entities that will appear in the With state. Press Enter to finish.
- In the Visibility States panel, the state called With is showing 3 entities using their handles (every entity created has a unique name referred to as its handle). Click the blue SheetNo option to return to the main panel of Visibility States.
- In the Visibility State panel, click on the arrow to the right of the state Without.
- Notice the handles of the entities from the With state are listed. The difference here is the visibility icon to the left of each handle appears with a slash through it meaning that these items will not be displayed in this state. Click the plus sign at the lower right corner of the panel and select the centered attribute to add it to the Without state. Press enter to finish.
- Notice in the Visibility States panel, the new handle appears and the visibility icon displays with no slash meaning this entity will be displayed.
- Note that if you click Back on the bottom left of the panel, then click the arrow to the right of With, all four handles are listed, but with the visibility setting reversed as indicated by the icon.
- Close the Block Editor by making the Block Editor ribbon tab current and clicking Save Block.
- Insert the block in the drawing, then click on it to display its properties in the Properties panel. Notice the parameters displayed now included SheetNo.
- Change the SheetNo parameter to Without.
- When attributes are used in visibility state, an ATTSYNC is required after the state is changed in properties. After the ATTSYNC, the block displays only the items configured to the Without state.
Using blocks with the visibility state parameter enables us to show variations of the block under certain standards or conditions. This allows us to avoid exploding symbology to force annotation to work. We can also avoid creating and maintaining slightly varied duplicates of the block in our libraries which keeps our block libraries lean. Overall, parametric blocks help us to work smarter and efficiently.
– Cyndy Davenport
Give BricsCAD a try. Download the trial today.