(defun c:tblFill ( / AWS N NCOLUMN NROW TBLFILLLIST VLA-OBJ X) (vla-startundomark (vla-get-activedocument(vlax-get-acad-object))) (if (and(setq aws (ssget "_X" (list (cons 0 "ACAD_TABLE") (cons 410 "Tabelle")))) (=(sslength aws) 1) (setq vla-obj (vlax-ename->vla-object(ssname aws 0)))) (progn (setq n 0) (repeat 110 (setq n (+ n 1) nRow (if (> n 55)(- n 55)n) nColumn (if (> n 55)3 0)) (setq tblFillList (cons (list nRow nColumn (itoa n) nil nil nil nil) tblFillList) tblFillList (cons (list nRow (+ nColumn 1) "0.123" 1 nil nil '(232 193 192)) tblFillList))) (mapcar '(lambda(X) (JBf_AcadTable:SetCellProps vla-obj (car X)(cadr X)(caddr X)(cadddr X)(nth 4 X)(nth 5 X)(nth 6 X))) (reverse tblFillList))) ) (vla-endundomark (vla-get-activedocument(vlax-get-acad-object))) ) ;;;Wert und Hintergrundfarbe einer Zelle eines ACAD_TABLE-OBjekte ändern ;;;Angabe der Zelle 1. Rows (Zeilen), 2. Columns (Spalten)jeweils beginnend bei 0 (defun JBf_AcadTable:SetCellProps (vla-obj nRow nColumn Text aciText rgbText aci rgb / VLA-COLOR) (if (and (< nColumn (vlax-get vla-obj 'Columns)) (< nRow (vlax-get vla-obj 'Rows))) (progn (if Text (vla-SetText vla-obj nRow nColumn Text)) (if (or aciText rgbText) (progn (setq vla-color (vla-getCellContentColor vla-obj nRow nColumn)) (if aciText (vla-put-colorIndex vla-color aciText) (vla-setRGB vla-color (car rgbText)(cadr rgbText)(caddr rgbText))) (vla-setCellContentColor vla-obj nRow nColumn vla-color))) (if (or aci rgb) (progn (setq vla-color (vla-getCellBackgroundColor vla-obj nRow nColumn)) (if aci (vla-put-colorIndex vla-color aci) (vla-setRGB vla-color (car rgb)(cadr rgb)(caddr rgb))) (vla-setCellBackgroundColor vla-obj nRow nColumn vla-color)))) ) )