Jump to content

Dropdown list on block


Recommended Posts

I would like to add a drop down list to a block. I would appreciate any help in getting this set up. Ive done a fair amount of research and it appears that things much more complex can be done but this simple task has me stumped.



We use the same block (symbol) to represent several different part numbers, but would like to select from a drop down list the actual part number. For example, a beacon symbol is the same no matter what color the beacon, but i would like to be able to select a grip and choose red, green, blue, yellow, ect. I don't want it to do anything to the block, but rather just store the property that is set by the user.


Any help would be greatly appreciated. I'm sure this isn't that hard, but i cannot figure it out.



Link to comment
Share on other sites

Sounds like a VISIBILITY or a REVERSE LOOKUP (for the GRIP style you mention) parameter added to a DYNAMIC BLOCK. :)

Edited by Dadgad
Link to comment
Share on other sites

Probably do it the other way around ask questions then insert block, various ways, but also can do retro insert block then adjust.


you can just ask questions on command line,

you can pop screen menus, not used much but is very simple to do.

you can pop up a dialouge,

some other look up method excel link.


maybe start with tool palletes

Link to comment
Share on other sites

Tool palettes had also seemed, to me, to be a very simple way to do this, with drag and drop ease,

or just creating the different distinct blocks with names like BconR, BconY, BconG where obviously

the final letter of the block name indicates the color. :)

Link to comment
Share on other sites

I can make the block perform as we desire using the visibility state, but it seems foolish to use the visibility state to perform an action that doesn't require any changes to the visibility block. I tried a lookup table, but when I go to the block their isn't a grip and if i go to the properties it only selects the first one in the list.


I cannot really do it the other way around as recommended by bigal for a bunch of reasons.

Link to comment
Share on other sites

Below is a copy of my response to your email, posted here for the benefit of the community:


Without turning to a .NET language (such as C#/F#/VB), or possibly even ObjectARX (C++), I would state that the functionality that you are looking to obtain is not possible to create using AutoLISP or Visual LISP since you would need to expand the inherent behaviour of an attributed block and high-level APIs such as AutoLISP can only work with the existing functionality available.


That is, with the exception of resorting to a hack by exploiting a vlr-miscellaneous-reactor to monitor the :vlr-pickfirstmodified event, and use this in conjunction with a hijacked POP0 custom shortcut menu to be displayed when a specific attributed block appears in the active pickset, subsequently altering the attribute value given the user input to the shortcut menu; however, this would involve substantial time and programming work to create and implement, which I doubt would be warranted for such a relatively minor gain in functionality.


My suggestion would be to use a Dynamic Block with multiple Visibility States wherein each Visibility State contains a constant attribute definition with the same attribute tag name across all States (hence the attribute information is read-only but may be extracted if required). The Visibility State names would then match the value of the constant attribute in each State to achieve the desired result.


I hope this helps,



Link to comment
Share on other sites

I tried a lookup table, but when I go to the block their isn't a grip .


The REVERSE LOOKUP style would incorporate the grip, per your original post.

Lee's input and opinion is no doubt right on the money, as usual. :)

Link to comment
Share on other sites

In the response to my email, the OP has noted that they wish to have a drop-down for multiple attributes in the block, and so I have offered this further suggestion, copied here for the benefit of the community:


Since you wish to modify multiple attributes in your block via a drop-down list, an alternative method to consider would be to use Field Expressions within the attribute values, linked to multiple Lookup Parameters in the Dynamic Block.


This way, the user could modify the value of the attribute using the relevant Lookup Parameter drop-down list and the value would be updated by the Field Expression referencing the Lookup Parameter. The only drawback of using this method is that a Regen would be required to update the Field housed in the attribute.


I have attached an animated gif to demonstrate this behaviour and have also copied my responses to your emails to your thread at the CADTutor forum to benefit the CAD community there.


Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...