It’s been a while since I wrote my last dynamic block tutorial. Besides of using parameters and actions, there is one thing left: using visibility states. You can hide and show some (or all) objects and save them on separate visibility state.
Let’s take a dynamic block sample from AutoCAD. I use the trees block. Insert it to your drawing, and click the down arrow in the block. You will see a list of trees. Try to change it to other type of tree.
What it does is hiding objects that form the palm (plan) and show other objects. Let’s try to create our own visibility states.
These doors are actually have a same door type. The only difference is the door on the left can be opened to inside and outside. And the other one can only be opened to one direction.
*What do you call them? single swing and double swing door?
Create a drawing like the door on the left. Make it as a block. Then open it in block editor. You’ve been doing this several of times, haven’t you? :)
We can’t click any button in visibility panel yet. To enable the visibility states, we need to place visibility parameter first. You can find it in block authoring palette, parameters tab.
Place it near your block. Pick a good spot, so you and others who will use it can find it easily.
Click the visibility states button. The visibility states dialog box will open.
By default, we will have one visibility state with name VisibilityState0. Select it, and click rename. Rename it to double swing door (or something you prefer).
Click new to create a new visibility state. Give it name single swing door. And make sure you select the leave visibility of existing objects unchanged in new state. Click OK.
AutoCAD will automatically set the new visibility state as current. If the single swing door is not current, select it and click set current. Click OK to close the dialog.
Now we will hide some lines. Activate make invisible from your ribbon.
Select all the dashed line that showing the door swing. [enter] to accept.
Click visibility mode to see/hide the invisible lines as opaque lines or hidden. You may want to set it as hidden to see applied changes clearly. But sometimes you need to see the invisible objects when you need to change it to visible.
Test your visibility state. Change it from one to another in visibility state list.
If everything is working fine, you can save the block and close the block editor.
Thank you for your detail explanation. This is just awesome.
hi, How to control visibility using VBA macro…
e.g. in vba, If control button is ON then show me X object, if another control button is On then show me Y object like that …how to control visibility in VBA ?
Good afternoon,
I currently work a little bit with AutoCAD 2014 in my work and I have a problem using Hyde situation with dynamic blocks, when I select one dynamic block, the hide situation filter out the block.
Can you help me?
Thank you in advance,
Bartolomeu Franco
it's quite just a bit different of how it should work in autocad 2012, I had to double click the visibility button to open up visibility test popup. Autocad stashes some sample in their dynamic block library
C:Program FilesAutodeskAutoCAD 2012 – EnglishSampleDynamic Blocks
WHAT VERISION ARE YOU USEING I FOLLOWED THIS 5 TIMES AND MY VISIBILITY PANEL IS STILL GRAYED OUT……
It should works in AutoCAD 2006 to the latest version. Have you placed the visibility parameter?
Thanks