See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: Dynamic block that shows/hides certain visibility states

  1. #1
    Login to Give a bone
    0

    Default Dynamic block that shows/hides certain visibility states

    Hello,

    I have a block function in mind I want to create but not sure what the correct language is to use to describe it. I want to have a visibility state selection determine which other visibility states can possibly be selected. From reading other posts I realize that you can only have 1 visibility parameter in a block but this is the best way I know how to describe it.

    Specifically in my block I am trying to create a block to use for both a "300 series" model and a "700 series" model. When the 300 series is selected, then I want to have 3 visibility states available to select from "SV1", "SV2", and "SV3". When the "700 series model is selected then I only want to have "SV01", "SV02", and "SV03" visibility states shown as available to select from. In this example the "SV1", "SV01", etc are just text. I have seen examples of using a lookup but they are for moving lines and shapes whereas I am just trying to enable/disable which visibility states are available to choose from. In my example I am using a Block Properties Table to reset the attributes to default value of "x" whenever the visibility state is changed.

    I am using LT 2016.

    I suspect there is a much more elegant way of doing this. Any suggestions of how to do this?
    Attached Files Attached Files

  2. #2
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    Use your current block table to drive the visibility states.

    Edit the current block table and add/create a new parameter. Name it something like "Series" and slide it to be the left most column. Enter 300 next to SV1 thru SV3 and 700 next to SV01 thru SV03. Clear the check box for the 'block properties must match a row in a table' in the lower left corner and ok your way out. Now test the block. When you select the block table the block will show two Series, 300 and 700, and then branch out to sub-menus for each SV# option for that specific series.

    Since the visibility states are set by the block table you can remove that grip as it isn't really needed any more.
    Attached Images Attached Images
    Last edited by MMccall; 2017-02-08 at 01:10 AM.

  3. #3
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    MM,

    Thanks for your reply! I got this to work as you described.

    Now I am trying to add also "SV10", "SV11", "SV12" and up to "SV20". For the 300 series model I need "CYCLES" to be shown below the rectangle and for the 700 series I need "SECONDS" to be shown. The only way I know of how to do this (in my limited CAD ability) is by creating visibility states for each SVxx with cycles and also ones with seconds. This would make a ton visibility states... is there an easier way to do this?

  4. #4
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    Rather than using the visibility states to swap the visibility of a piece of text that reads on thing to one that reads another, lets place one text item and then just change what it reads via the table. Replace the current CYCLES text with an Attribute. Add this attribute to the table and enter the what you want it to read for each of the SV## rows.

    .... be sure to add this new attribute to show in all visibility states ... I've forgot to do this too many times.

    All of your text values could be replaced with attributes driven by the block table and remove the need for any visibility states. Multiline values can be done as well.

    As a bonus to it being an attribute is that you can still manually edit the value to whatever you want for the one-off freak of nature instance, yet still revert back to tabled values when you choose a different one from the table menu.

  5. #5
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    I previously looked at using attributes and adding them to the table, but I do not want all of the attributes to appear in the Enhanced Attribute Editor window. I only want a couple items to appear in the pop up window, in this case SVNPU and SVNDO.

    Capture.JPG

    I have played around with the Mode selections when creating the attribute (Invisible, Constant, Verify, etc.) but cannot figure out how to make the other attributes not appear in the Enhanced Attribute Editor window and still be able to use them in the table. Is there a way to get some attributes to appear in the Enhanced Attribute Editor window and some attribute to not appear?

    To take it a step further, is there a way to have attributes appear in the pop-up window only when a certain visibility or table combination is selected. For example when I select "300 series" and "SV4", can I make attribute appear (by visibility state I think I can do this) and then appear in the Enhanced Attribute Editor window (not sure how to do this part)?
    Attached Files Attached Files

  6. #6
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    1

    Default Re: Dynamic block that shows/hides certain visibility states

    Hmm, this took a little while as I was hoping for a more elegant solution than I ended up with.

    I wish there was a way to lock an attribute such that it can only be changed from the table, and, not show up in the attribute editor.

    Ok, I replaced the TYPE attribute with a parameter, default name of User1, added it to the table, copied the values over from the TYPE attribute, deleted the TYPE attribute and renamed the User1 parameter to TYPE. The moved its column all the way to the left. The table works as it did but now there is no attribute for the type. The parameter functions only as an organization unit for the block table menu.

    I had to abandon the idea of having the UNITS as an attribute. I couldn't find a way to have it visible but not able to be edited. I resorted to two simple text items added to the appropriate visibility states that already existed. Not elegant, but it works. I attached the final result.
    Attached Files Attached Files

  7. #7
    100 Club
    Join Date
    2004-10
    Location
    Scotland
    Posts
    102
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    Blank attributes - insert a non-breaking space from the windows character map?

  8. #8
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    439
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    I've had no problem with a blank entry as long as the table entry is only supplying a value to an attribute. A blank value for something like a linear parameter won't fly, nor will a value of zero.

  9. #9
    Member
    Join Date
    2006-02
    Posts
    8
    Login to Give a bone
    0

    Default Re: Dynamic block that shows/hides certain visibility states

    WOW! This is an excellent tutorial post from which I have learned a lot. I'm just looking for an opportunity to use the block table now.
    Great job Mccall.

    Sal

Similar Threads

  1. LSP & Dynamic Block Visibility States
    By ReachAndre in forum AutoLISP
    Replies: 1
    Last Post: 2007-11-20, 09:32 AM
  2. Dynamic blocks, Visibility states, Attributes
    By megumby in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2007-08-03, 05:06 AM
  3. Getting Visibility States to work in a Single door Dynamic Block
    By KGC in forum Dynamic Blocks - Technical
    Replies: 3
    Last Post: 2007-01-02, 03:40 PM
  4. Is there a way to see all Visibility states within a Dynamic Block
    By KansasCAD in forum Dynamic Blocks - Technical
    Replies: 3
    Last Post: 2006-04-17, 06:51 PM
  5. Loose dynamic states from sub block after insertion into master block
    By ANRCREATIONS in forum Dynamic Blocks - Technical
    Replies: 5
    Last Post: 2005-11-15, 02:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •