Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been looking all over for a .lsp or some code I can tweak to make work for me to no avail. I found this from another forum, but it is for changing the text style of each cell:
(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)
I would like to tweak this to simply set all cell grid lineweights of the table to a specified variable (in my case ByBlock). I already tweaked it to this, but it doesn't work and I don't know what else to do:
(defun c:Test ( / lwt tbl obj row col r c)
(setq lwt ByBlock) ;; Change the table cell lineweight to suit your desired one.
(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-setcellgridlineweight obj r c lwt) (setq c (1+ c))
)
(setq r (1+ r) c 0)
)
)
(princ)
)
Here are a couple screenshots of what I need to do, change all lineweights to be the same, while keeping all other formatting the same, especially removed (invisible) borders:
Please help, even if simply pointing to another forum post that can help would be appreciated.
Solved! Go to Solution.