hosneyalaa Posted August 5, 2019 Posted August 5, 2019 Hello all I found a code to create a newStyle for the table On this page https://forums.augi.com/showthread.php?47551-How-to-create-a-new-TableStyle this lisp (defun C:tryit (/ acmcol adoc clsname keyname newstyleobj tbldict tblstylename) (vl-load-com) (or adoc (setq adoc (vla-get-activedocument (vlax-get-acad-object) ) ) ) (setq tbldict (vla-item (vla-get-dictionaries (vla-get-database adoc) ) "Acad_TableStyle" ) ) ;; look in the tablestyle dictionary to search for our style name: (if (vl-catch-all-error-p (setq tbstyleObj (vl-catch-all-apply (function (lambda() (vla-item tbldict "TblStyleName"))))));change table style name here ;; if table style "TblStyleName" does not exist: (progn (setq keyname "NewStyle" clsname "AcDbTableStyle" tblstylename "TblStyleName" ;change table style name here ) (setq newstyleobj (vlax-invoke tbldict 'Addobject keyname clsname) ) (setq acmcol (vla-GetInterfaceObject (vlax-get-acad-object) (strcat "AutoCAD.AcCmColor." (itoa (atoi(getvar "acadver")))) ) ) (vlax-put acmcol 'Colorindex 121) (vlax-put newstyleobj 'Name TblStyleName) (vlax-put newstyleobj 'Description "Your description here") ;or use style name as the description (vlax-put newstyleobj 'HorzCellMargin 0.06) (vlax-put newstyleobj 'VertCellMargin 0.06) (vlax-put newstyleobj 'TitleSuppressed :vlax-false) (vlax-put newstyleobj 'HeaderSuppressed :vlax-false) (vlax-invoke newstyleobj 'SetColor acDataRow acmcol) (vlax-invoke newstyleobj 'SetBackgroundColorNone acDataRow :vlax-false ) (vlax-invoke newstyleobj 'SetTextStyle acDataRow "Standard");change textstyle name here (vlax-invoke newstyleobj 'SetTextHeight acTitleRow 0.25) (vlax-invoke newstyleobj 'SetTextHeight acHeaderRow 0.2) (vlax-invoke newstyleobj 'SetTextHeight acDataRow 0.18) (vlax-invoke newstyleobj 'SetGridVisibility acVertInside acDataRow :vlax-true) (vlax-invoke newstyleobj 'SetAlignment acDataRow acMiddleCenter ) ;| ETC add another options here|; ) ;;inform user if style exist: (princ "\n\t\t ***\tStyle already exist\t***") ) (princ) ) How to add an options to this lisp As shown in the attached picture About the red line Activation DoubleLine give DoubleLineSpacing 0.5 Activate borders from all sides Thanks in advance Quote
ronjonp Posted August 5, 2019 Posted August 5, 2019 You'd probably be better off creating a template with your tablestyle in it then importing. 1 1 Quote
BIGAL Posted August 6, 2019 Posted August 6, 2019 (edited) Just a guess start googling SetDoubleline acDataRow tables are a bit like Dims so many variables. This took 30 seconds and look at where the answer is. Edited August 6, 2019 by BIGAL 1 Quote
hosneyalaa Posted August 6, 2019 Author Posted August 6, 2019 Thank you very much BIGAL I saw the subject and worked lisp for him Modifying an existing table only works I wanted to add this feature to the lisp above Without the need for modification (defun DLT (tbl / rws #columns z x ) (and (setq rws (vla-Get-Rows tbl)) (setq #columns (vla-get-Columns tbl)) );; and (setq x 0) (setq Z 0) (repeat rws (repeat #columns (vla-SetGridDoubleLineSpacing tbl X Z (+ acHorzBottom acHorzTop acVertLeft acVertRight) 0.2) (vla-setgridlinestyle tbl X Z (+ acHorzBottom acHorzTop acVertLeft acVertRight) acgridlinestyledouble) (setq Z (+ Z 1))) (setq Z 0) (setq x (+ x 1)) ) ) If there is no solution or idea thank you to everyone Quote
ronjonp Posted August 6, 2019 Posted August 6, 2019 5 hours ago, BIGAL said: Just a guess start googling SetDoubleline acDataRow tables are a bit like Dims so many variables. This took 30 seconds and look at where the answer is. I saw that thread as well. The issue is the OP was asking how to apply that double line to the TABLESTYLE not the TABLE 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.