Author Topic: Block Attribute with Listed Values  (Read 1707 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
Block Attribute with Listed Values
« on: June 13, 2020, 01:09:43 PM »
Hi,
I have created a Block with 1 Attribute in which the user can enter any value by going to Properties (CH command).
However, I want that user should be able to put a value among 1, 2 or 3 only.
There should be a dropdown in the Properties Window (using CH command) against the attribute such that the user can selected any one of the above three values (1, 2 or 3). How to add the dropdown against the attribute using LISP ?

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Block Attribute with Listed Values
« Reply #1 on: June 13, 2020, 06:06:17 PM »
You can accomplish this using a dynamic block, with no LISP required.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Block Attribute with Listed Values
« Reply #2 on: June 15, 2020, 03:56:49 PM »
As Lee mentioned, use a block properties table like so.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mailmaverick

  • Bull Frog
  • Posts: 493
Re: Block Attribute with Listed Values
« Reply #3 on: June 16, 2020, 07:41:17 PM »
Thanks Lee and Ron. I am able to create the Dynamic Block by adding Attribute Definition and Block Table linked to the Attribute Definition manually and the block is working fine.

I am also able to add Attribute Definition through LISP.
But I am not able to add Block Table (linked to added Attribute Definition) through LISP.
Any leads on that ? Thanks.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Block Attribute with Listed Values
« Reply #4 on: June 17, 2020, 11:36:42 AM »
...
But I am not able to add Block Table (linked to added Attribute Definition) through LISP.
Any leads on that ? Thanks.

I don't know how to add that link via lisp. Why is a lisp solution needed for this? You create the block once then you're good right?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mailmaverick

  • Bull Frog
  • Posts: 493
Re: Block Attribute with Listed Values
« Reply #5 on: June 18, 2020, 02:17:46 PM »
Actually there is not 1 block, I have many different blocks in which I have to add this functionality. Request other forum members to provide any leads if possible. Thanks.