Message 1 of 2
Set Cell Style via Lisp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous_dude wrote:
How do make a lisp go through all cells (rows, columns) and set the cell style?
I have "(vla-setcellstyle 0 1 "data")" working, but I dont want to have to program over 100 cells individually.
You will have to loop through all cells. Something like this for example.
;;Ranjit Singh ;;7/11/17 (defun somefunc (x tblent / c etdata ind r tab tblobj) (setq etdata (entget tblent) ind (cdr (assoc 91 etdata)) tab (cdr (assoc 92 etdata)) r 0 c 0 tblobj (vlax-ename->vla-object tblent)) (while (< r ind) (while (< c tab) (vl-catch-all-apply 'vla-setcellstyle (list tblobj r c x)) (setq c (1+ c))) (setq c 0 r (1+ r))) (princ))
Call it in your overall routine like this
(somefunc "data" tblent)