<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Reset Table cell border lineweights in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591375#M17191</link>
    <description>&lt;P&gt;I have been looking all over for a .lsp or some code I can tweak to make work for me to no avail.&amp;nbsp; I found this from another forum, but it is for changing the text style of each cell:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(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 &amp;lt;" sty "&amp;gt; is not found in drawing &amp;lt;!&amp;gt;"))
            )
        (princ "\nPick on Table :")
        (setq tbl (ssget "_+.:S:E:L" '((0 . "ACAD_TABLE"))))
        (setq obj (vlax-ename-&amp;gt;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)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I would like to tweak this to simply set all cell grid lineweights of the table to a specified variable (in my case ByBlock).&amp;nbsp; I already tweaked it to this, but it doesn't work and I don't know what else to do:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(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-&amp;gt;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)
 )&lt;/LI-CODE&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mbeachRCJ54_0-1709226661867.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1332013iEC27A6B05168737E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mbeachRCJ54_0-1709226661867.png" alt="mbeachRCJ54_0-1709226661867.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please help, even if simply pointing to another forum post that can help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 17:14:25 GMT</pubDate>
    <dc:creator>m_beach89</dc:creator>
    <dc:date>2024-02-29T17:14:25Z</dc:date>
    <item>
      <title>Reset Table cell border lineweights</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591375#M17191</link>
      <description>&lt;P&gt;I have been looking all over for a .lsp or some code I can tweak to make work for me to no avail.&amp;nbsp; I found this from another forum, but it is for changing the text style of each cell:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(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 &amp;lt;" sty "&amp;gt; is not found in drawing &amp;lt;!&amp;gt;"))
            )
        (princ "\nPick on Table :")
        (setq tbl (ssget "_+.:S:E:L" '((0 . "ACAD_TABLE"))))
        (setq obj (vlax-ename-&amp;gt;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)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I would like to tweak this to simply set all cell grid lineweights of the table to a specified variable (in my case ByBlock).&amp;nbsp; I already tweaked it to this, but it doesn't work and I don't know what else to do:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(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-&amp;gt;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)
 )&lt;/LI-CODE&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mbeachRCJ54_0-1709226661867.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1332013iEC27A6B05168737E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mbeachRCJ54_0-1709226661867.png" alt="mbeachRCJ54_0-1709226661867.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please help, even if simply pointing to another forum post that can help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:14:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591375#M17191</guid>
      <dc:creator>m_beach89</dc:creator>
      <dc:date>2024-02-29T17:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Table cell border lineweights</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591403#M17192</link>
      <description>&lt;P&gt;Possibly like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:Test ( / lwt tbl obj row col r c)
  
  (setq lwt acLnWtByBlock) ;; Change the table cell lineweight to suit your desired one.
  ;; https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-84954C42-12E8-4729-8276-2B3B77AB24B2
  
  (princ "\nPick on Table :")
  (setq tbl (ssget "_+.:S:E:L" '((0 . "ACAD_TABLE"))))
  (setq obj (vlax-ename-&amp;gt;vla-object (ssname tbl 0))
	row (vla-get-rows obj)
	col (vla-get-columns obj)
	r 0 c 0
	)
  
  (repeat row
    (repeat col
      (foreach mask (list acBottomMask acLeftMask acRightMask acTopMask)
	(vla-setcellgridlineweight obj r c mask lwt))
      (setq c (1+ c)))
    (setq r (1+ r) c 0))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591403#M17192</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-02-29T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Table cell border lineweights</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591422#M17193</link>
      <description>&lt;P&gt;OMG thank you so much!!!&amp;nbsp; Works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just out of curiosity, how hard would it be to make it so I can select multiple tables at once?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:36:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591422#M17193</guid>
      <dc:creator>m_beach89</dc:creator>
      <dc:date>2024-02-29T17:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Table cell border lineweights</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591431#M17194</link>
      <description>&lt;PRE&gt;(defun c:Test ( / lwt tbls i obj row col r c)
  
  (setq lwt acLnWtByBlock) ;; Change the table cell lineweight to suit your desired one.
  ;; https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-84954C42-12E8-4729-8276-2B3B77AB24B2
  
  (princ "\nSelect tables,")
  (setq tbls (ssget ":L" '((0 . "ACAD_TABLE"))))
  (repeat (setq i (sslength tbls))
    (setq obj (vlax-ename-&amp;gt;vla-object (ssname tbls (setq i (1- i))))
	  row (vla-get-rows obj)
	  col (vla-get-columns obj)
	  r 0 c 0
	  )
    
    (repeat row
      (repeat col
	(foreach mask (list acBottomMask acLeftMask acRightMask acTopMask)
	  (vla-setcellgridlineweight obj r c mask lwt))
	(setq c (1+ c)))
      (setq r (1+ r) c 0)))
    (princ)
    )
&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:42:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591431#M17194</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-02-29T17:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Table cell border lineweights</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591440#M17195</link>
      <description>&lt;P&gt;You are a god.&amp;nbsp; Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:47:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/reset-table-cell-border-lineweights/m-p/12591440#M17195</guid>
      <dc:creator>m_beach89</dc:creator>
      <dc:date>2024-02-29T17:47:06Z</dc:date>
    </item>
  </channel>
</rss>

