Convert Data of Block Attribute in text multilines
Good morning,
I liked to know how it was possible to convert data contained in a block Attribute, in texts multilines, always in my drawings (no export of text file). I try to search, I do not find ......
Thank you
0
Comments
-
This is my lisp for doing that, which I use a lot. It might need polish to work for you and it's probably no example of good programming, but there it is.
(DEFUN c:CAT (/ oldl oldlp ss n p1 a b c p q p2 p3 p4 r s)
(SETVAR "CMDECHO" 0)
(SETQ OM (GETVAR "OSMODE"))
(SETVAR "OSMODE" 0)
(if (/= 0 (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))))
(progn
(princ "\nTextsize must be 0 ")(terpri))
(progn
(setq oldl (getvar "clayer"))
(COMMAND "LAYER" "M" "DEFPOINTS" "")
(SETQ OLDP (GETVAR "LUPREC"))
(SETVAR "LUPREC" 0)
(setq ss (ssget "x" '((0 . "INSERT")(66 . 1))) n 0 p1 nil p1 (getpoint "\nStart Point: "))
(while (/= n (sslength ss))
(setq a (ssname ss n) b (entnext a) c (entnext (entnext a))
d (entnext (entnext (entnext a)))
p (cdr (assoc 2 (entget b)))
q (cdr (assoc 1 (entget b)))
p2 (polar p1 0 (* (getvar "textsize") 12))
p3 (polar p1 0 (* (getvar "textsize") 24))
p4 (polar p1 0 (* (getvar "textsize") 36)))
(if (= "ATTRIB" (cdr (assoc 0 (entget b))))
(progn
(setq p (cdr (assoc 2 (entget a))))
(command "text" p1 "" "" p)))
(if (= "ATTRIB" (cdr (assoc 0 (entget b))))
(progn
(setq q (cdr (assoc 1 (entget b))))
(command "text" p2 "" "" q)))
(if (= "ATTRIB" (cdr (assoc 0 (entget c))))
(progn
(setq r (cdr (assoc 1 (entget c))))
(command "text" p3 "" "" r)))
(if (= "ATTRIB" (cdr (assoc 0 (entget d))))
(progn
(setq s (cdr (assoc 1 (entget d))))
(command "text" p4 "" "" s)))
(setq n (1+ n) p1 (polar p1 (* 1.5 pi)(* (getvar "LTSCALE") 0.4)))
)
(SETVAR "LUPREC" OLDP)
(command "layer" "S" oldl "")
))
(SETVAR "OSMODE" OM)
)0
This discussion has been closed.