Craisbeck Posted September 9, 2012 Posted September 9, 2012 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. Background: 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. Thanks Quote
Dadgad Posted September 9, 2012 Posted September 9, 2012 (edited) Sounds like a VISIBILITY or a REVERSE LOOKUP (for the GRIP style you mention) parameter added to a DYNAMIC BLOCK. Edited September 9, 2012 by Dadgad Quote
BIGAL Posted September 9, 2012 Posted September 9, 2012 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 Quote
Dadgad Posted September 9, 2012 Posted September 9, 2012 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. Quote
Craisbeck Posted September 9, 2012 Author Posted September 9, 2012 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. Quote
Lee Mac Posted September 9, 2012 Posted September 9, 2012 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, Lee Quote
Dadgad Posted September 10, 2012 Posted September 10, 2012 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. Quote
Lee Mac Posted September 10, 2012 Posted September 10, 2012 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. Quote
Lee Mac Posted September 12, 2012 Posted September 12, 2012 Were you able to solve this Craisbeck? Quote
Recommended Posts
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.