ILoveMadoka Posted January 12, 2021 Posted January 12, 2021 (edited) Autocad 2020 Out of the box, to make a change to an existing table / tablestyle (specifically the border line weights/fonts) to BYLAYER You have to start the TABLESTYLE command, pick the desired style (we have 12 separate ones) Pick the Borders tab, pick modify, pick the cell style (3ea), pick the border and assign the lineweight, linetype and color to ALL BORDERS. Pick the Text tab and change the font and text height and color. Change to the next cell style and repeat all those steps again. I have a directory full of drawings that have screwed up tables and wanted to know if there was an easier way? Is there a command line option? Any way to "Save" a table in order to replace one with another? Can such changes be scripted? Has anyone seen any autolisp routines for accomplishing such? Any help/advice is greatly appreciated... here is an example: I want it to look more like the one below (without having to jump thru all the hoops to get it this way) maybe not quite this light but all the lines the same thickness Edited January 12, 2021 by ILoveMadoka Quote
BIGAL Posted January 13, 2021 Posted January 13, 2021 Maybe this (vlax-put obj 'StyleName "Standard") need multi tables to test. It may need some other table regen to take affect. It was returning change of style name in a simple test. Quote
ILoveMadoka Posted April 12, 2023 Author Posted April 12, 2023 Revisiting this topic.... I came across this code from Tharwat (defun c:Test ( / sty tbl obj row col r c) ;; Tharwat - Date: 11.Jul.2017 ;; (setq sty "Standard") ;; Change the Text Style to suit your desired one. (if (and (or (tblsearch "STYLE" sty) (alert (strcat "Text style <" sty "> is not found in drawing <!>")) ) (princ "\nPick on Table :") (setq tbl (ssget "_+.:S:E:L" '((0 . "ACAD_TABLE")))) (setq obj (vlax-ename->vla-object (ssname tbl 0)) row (vla-get-rows obj) col (vla-get-columns obj) r 0 c 0 ) ) (repeat row (repeat col (vla-setcelltextstyle obj r c sty) (setq c (1+ c)) ) (setq r (1+ r) c 0) ) ) (princ) ) (vl-load-com) and I was wondering can this methodology be used to change the border color of all cell styles to Bylayer? I was hoping the BYLAYER command would do it but it does not change Tablestyles or Cell Styles. I don't know where to begin. I also created a "clean" table style then changed my existing tables to that new style but the cell styles kept their original settings. Should I make this a new question? Quote
ILoveMadoka Posted April 12, 2023 Author Posted April 12, 2023 I also found this setting cell margins (defun c:Example_CellMargin_by_Jef() (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq dictionaries (vla-get-Dictionaries doc)) (setq dictObj (vla-Item dictionaries "acad_tablestyle")) (setq keyName "Copy of Standard");name of table style to be changed (setq tempObj (vla-GetObject dictObj keyName)) (vla-put-HorzCellMargin tempObj 0.22) (vla-put-VertCellMargin tempObj 0.25) ) I'm dancing all around this with no luck... Quote
BIGAL Posted April 14, 2023 Posted April 14, 2023 Do you have another post re table mods ? You can massively overwrite an existing table and change its appearance. Quote
Steven P Posted April 14, 2023 Posted April 14, 2023 For completion, the discussion was also here and more complete 1 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.