Tablestyle update

Tablestyle update

Hans_Knol
Advocate Advocate
652 Views
5 Replies
Message 1 of 6

Tablestyle update

Hans_Knol
Advocate
Advocate

In AutoCAD you have a Tablestyle, but does anybody have a LISP routine or can create one to update the Style and make it equal to an other style that somewhere on the diskdrive in the path.

Hans Knol
0 Likes
653 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend

Like a MATCHPROP command but for tablestyles? Or something else?

0 Likes
Message 3 of 6

Hans_Knol
Advocate
Advocate

Correct, but it must be runned in a LISP becourse it must change all files in a lot of projects, the Idea is to add it to the acaddoc.lsp so all files that will be opened will changed automaticly

Hans Knol
0 Likes
Message 4 of 6

Sea-Haven
Mentor
Mentor

You can make a tablestyle via lisp, so could check does style exist if not make it. Only but is that values are fixed, but can make more than one tablestyle.

 

 

(setq dicts (vla-get-Dictionaries (vla-get-ActiveDocument(vlax-get-acad-object))))
(setq dictObj (vla-Item dicts "acad_tablestyle"))
(vlax-for dname dictobj
(if (=  (vla-get-name dname) "Yourtable" ) ; does it exist
(setq Tabfound "found")
)
)

(if (= tabfound "found")
(princ)
do the make table here
)

 

Need a sample table for the make part, to many variables to guess.

 

 

 

 

0 Likes
Message 5 of 6

daniel_cadext
Advisor
Advisor

Table styles are finicky with cloning, but this will copy all of the style

 

You would be better off mapping the changes and use objectDBX.

https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-409A6709-D3D9-4D7D-AC60-163444D58FBA

 

You may have to call RecomputeTableBlock if you change a style for an existing table

https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-7B82400C-53D0-4D1A-94FA-66BB3040F0AA

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Then there is a easy way can run Steal by Lee-mac from a lisp use a (load "Steal....) 1st which loads Lee's code, then can call a defun (steal ......) with correct options and get a table style. Just go to Lee-mac.com for latest version. Have used it without user input many times.

 

SeaHaven_0-1720671605757.png

More options available.

0 Likes