Message 1 of 19
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi everyone!
I found the following Lee Mac routine, and I need you to help me modify it.
lisp converts the text to attributes.
- I need them to be able to convert texts that are inside the block, without having to enter the block.
- when they are already converted, they are assigned the default property "Multiples Lines".
- The default text of the ATT, should not have "_" between texts.
Thanks for the help
;; Txt2Att ( Lee Mac )
;; Converts Single-line Text to Attribute Definition
(defun c:txt2att ( / StringSubst RemovePairs ss ent eLst str dx73 )
(vl-load-com)
;; Lee Mac ~ 27.04.10
(defun StringSubst ( new pat str )
(while (vl-string-search pat str)
(setq str (vl-string-subst new pat str))
)
str
)
(defun RemovePairs ( lst pairs )
(vl-remove-if
(function
(lambda ( pair )
(vl-position (car pair) pairs)
)
)
lst
)
)
(if (setq ss (ssget "_:L" '((0 . "TEXT"))))
( (lambda ( i )
(while (setq ent (ssname ss (setq i (1+ i))))
(setq eLst (entget ent)
str (StringSubst "_" " " (cdr (assoc 1 eLst)))
dx73 (cdr (assoc 73 eLst)))
(setq eLst (RemovePairs eLst '( 0 100 1 73 )))
(if (entmake (append '( (0 . "ATTDEF") ) eLst (list (cons 70 0)
(cons 74 dx73)
(cons 1 str)
(cons 2 str)
(cons 3 str))))
(entdel ent)
)
)
)
-1
)
)
(princ))
Edwin Saez
LinkedIn / AutoCAD Certified Professional
Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.
Solved! Go to Solution.