Table LISP Help - Lisp to set Row Style, Enable Table Breaks, Repeat top labels

Table LISP Help - Lisp to set Row Style, Enable Table Breaks, Repeat top labels

njs
Observer Observer
843 Views
0 Replies
Message 1 of 1

Table LISP Help - Lisp to set Row Style, Enable Table Breaks, Repeat top labels

njs
Observer
Observer

Hi, 

I am importing tables into autocad from excel and I always have to turn on table breaks and repeat top labels. I'm looking for a little help on writing a lisp that will automatically set the top row style to Title, the second row to Header. I also would like enable table breaks and repeat top labels. I'm new to LISPs, I have compiled the following lisp so far. Any help would be much appreciated.:)


(vl-load-com)
(defun C:format-panel-schedule()
*command to run lisp ^
(setq tbl (vlax-ename->vla-object(car(entsel))))
(setq rows (vla-get-rows tbl))
(setq currentRow 0)
(vla-setrowheight tbl currentRow 1) ;Change row height (TEST)
(setq currentRow (+ 0 currentRow))
(setq TotalRowCount (vla-get-rows tbl))
(setq RowNumber 0)
(while (< RowNumber TotalRowCount)
(vla-setrowheight tbl RowNumber 5.707)
*sets all row heights ^
(setq RowNumber (+ RowNumber 1))
);while

(vla-setcolumnwidth tbl 0 100)
(vla-setcolumnwidth tbl 1 15)
(vla-setcolumnwidth tbl 2 15)
(vla-setcolumnwidth tbl 3 15)
(vla-setcolumnwidth tbl 4 15)
(vla-setcolumnwidth tbl 5 15)
(vla-setcolumnwidth tbl 6 15)
(vla-setcolumnwidth tbl 7 15)
(vla-setcolumnwidth tbl 8 100)

*SELECTS TABLE LOCATION
(setq tbl (getpoint))
(COMMAND "EDITTABLECELL" tbl "A1:Z1000" "C" "U" "Q")

*SETS TOP ROW OF TABLE TO Title
(COMMAND "EDITTABLECELL" tbl "A1:I1" "S" "S" "Title" "Q")

*SETS ALL OTHER CELLS TO DATA
(COMMAND "EDITTABLECELL" tbl "A2:I4" "S" "S" "Data" "Q")

*SETS DESCRIPTION AND NOTES CELLS TO DESCRIPTION
(COMMAND "EDITTABLECELL" tbl "A5:A1000" "S" "S" "Description" "Q")

*SETS DESCRIPTION AND NOTES CELLS TO DESCRIPTION
(COMMAND "EDITTABLECELL" tbl "I5:I1000" "S" "S" "Description" "Q")


)

0 Likes
844 Views
0 Replies
Replies (0)