As we’ve seen in previous posts, Dynamic Blocks open a whole new world of building smart, configurable, and flexible blocks. In a previous life I was involved with a company that reduced their block library from over 10,000 items to just below 500. You might be thinking “Whatever Mike”, but this was a company that designed the electrical portion of commercial buildings. They didn’t really have that many types of blocks, just 100’s of iterations of the same item, slightly adjusted based on size, options, or manufacturer. Pulling all this data into one configurable item is where the savings occurred.
If you haven’t checked out dynamic blocks, read these first… Dynamic Blocks Part 1 and Part 2
In this final mini-deep dive on Dynamic Blocks lets explore visibility, how you can manage what is shown and what isn’t shown in the various versions of the block.
First start with the objects. You really have two options: Create all the objects up front or create the objects as they are required. In this example I’ve created a line and two circles and I’m going to create two versions…. one with the circles on and another with the circles off.
Add a Visibility Parameter.
The location of the parameter sets the location of the visibility grip. It also enables the Visibility Controls in the ribbon.
- Launch the Visibility States dialog
- Visibility Mode – Toggles between seeing invisible objects and not seeing them
- Make Visible / Make Invisible – Select objects to make visible or make invisible
- Active Visibility State
From within the Visibility State dialog rename the active state something more meaningful. Remember this is what the user will see when they select the visibility state to use.
When creating a new state, three options are presented to deal with the existing geometry: Turn all on, Turn all off, or leave as is. The option to use really depends on the existing geometry and what you need to do with the geometry visibility.
In this case I use “Leave visibility of existing objects unchanged in new state” leaving what is visible on and what is currently invisible toggled off.
I use the Make Invisible to turn off the two circles. By using Visibility Mode I toggle the invisible geometry to appear ghosted so that they can still be selected and included in other actions I include in the block. To test the functionality use the Visibility States drop-down to switch back and forth between the states.
See it in action here…
Feature Image Universal Invisible Woman by JD Hancock