Adding automaticlly text to table

Adding automaticlly text to table

mateusz_banas
Explorer Explorer
298 Views
1 Reply
Message 1 of 2

Adding automaticlly text to table

mateusz_banas
Explorer
Explorer

Good morning,

I am writing to you with a question regarding LISP in AutoCAD. I am just starting to work with it and I have encountered a problem. Is it possible to create a table with columns TYPE, WIDTH, HEIGHT, THICKNESS in LISP? I would like the table to populate itself automatically when clicking on the description text of profiles, as shown in the attached image. WheZrzut ekranu 2024-03-12 094854.pngre should I start?

0 Likes
299 Views
1 Reply
Reply (1)
Message 2 of 2

Michiel.Valcke
Advisor
Advisor

it's a bit complicated and convoluted, but it is possible.

You can create a table with lisp and you can set the value of any table cell with lisp (through ActiveX)
https://www.cadtutor.net/forum/topic/71672-create-a-table-by-lisp/
https://adndevblog.typepad.com/autocad/2012/04/autolisp-example-create-a-table-using-activex.html

 

Then you will want a function that lets you select the text / description and read it's content. This can be done in a multitude of ways. For example (entget (car (entsel))) to get the entity description. To get a specific Dxf code, you need to know if your object will be text (dxf 1 for content) or a multileader (dxf 304 for text content), then you can use (cdr (assoc (DXFcode (entget ename))))

then you just need to read your text, depending on how it's built up you can use the trim functions in autolisp to cut it into pieces and place each piece in a list and from there pass them to your table function. https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-532CDF83-7A7F-4B54-8362-F5B7FB35C220

 

There are people over at the lisp forum that can help you with more code snippets or that you can hire to develop this for you.
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130

0 Likes