Hi, I'm working with some code that will automate formatting some mtext. I want the dxf code 90 to be set to 2 so I can use drawing window color as background fill color. When 90 is set to 1, and 63 is set to white is a valid solution for me, but I was curious as to why 2 doesnt work?
(defun c:mblank ( / js n dxf_ent) (setq js (ssget "X" '((8 . "CTEXT")))) (sslength js) (cond (js (repeat (setq n (sslength js)) (setq dxf_ent (entget (ssname js (setq n (1- n))))) (entmod (append dxf_ent '((90 . 1) (63 . 255) (45 . 1.1) (62 . 7)))) ) ) ) )
Solved! Go to Solution.
Solved by cadffm. Go to Solution.
@Anonymous hi,
here is an example on how to modify (entget) list
enjoy
moshe
(setq elist (entget (car (entsel)))) (mapcar '(lambda (dxf val) (if (assoc dxf elist) (setq elist (subst (cons dxf val) (assoc dxf elist) elist)) ) ) (list 45 62 63 90) ; leave it for you to verify if these (list 1.0 7 2 3) ; value are suit to these dxf code ) (entmod elist) ; upadte entity database
(list 45 62 63 90) ; leave it for you to verify if these (list 1.0 7 256 3) ; value are suit to these dxf code
@Anonymous
>" I want the dxf code 90 to be set to 2"
a) Check the entitylist of a new MText without background informations
(foreach i (setq a (entget(car(entsel))'("*")))(print i))
b) Check the entitylist of MText with background ON and set to use background window color
(foreach i (setq a (entget(car(entsel))'("*")))(print i))
c) Check the entitylist of a new MText with background ON and background color set to 123 for example
(foreach i (setq a (entget(car(entsel))'("*")))(print i))
You will see, AutoCAD set the value of groupcode 90 to 1 or 3, so you need value 3 instead of 2.
Sebastian
Can't find what you're looking for? Ask the community or share your knowledge.