TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: confusedCADguy on April 01, 2004, 03:45:51 PM

Title: attribute text to dtext
Post by: confusedCADguy on April 01, 2004, 03:45:51 PM
Greetings all,

I have numerous drawings with a base plan xrefed into it. I have quite a few blocks with attributes that have been exploded. Yes that’s right, exploded. Now everyone knows you shouldn't explode blocks with attributes if they are being xrefed. So anyway, now that I’m done beating the a$$ of the person who did it I need to know if there is a way to convert the exploded attributes to dtext. I tried TXT2MTXT.lsp and for some reason the text disappears even though it says an mtext object was added.

Thanks
Title: attribute text to dtext
Post by: CAB on April 01, 2004, 04:26:09 PM
I have not tried this one..


Code: [Select]
; ----------------------------------------------------------------------
; DISCLAIMER:  DotSoft Disclaims any and all liability for any damages
; arising out of the use or operation, or inability to use the software.
; FURTHERMORE, User agrees to hold DotSoft harmless from such claims.
; DotSoft makes no warranty, either expressed or implied, as to the
; fitness of this product for a particular purpose.  All materials are
; to be considered ‘as-is’, and use of this software should be
; considered as AT YOUR OWN RISK.
; ----------------------------------------------------------------------

(defun C:TAG2TXT ()
  (setq sset (ssget '((0 . "ATTDEF"))))
  (setq num (sslength sset) itm 0)
  (while (< itm num)
    (setq hnd (ssname sset itm))
    (setq ent (entget hnd))
    (setq new '((0 . "TEXT")))
    (setq new (append new (list (cons 1 (cdr (assoc 2 ent))))))
    (setq dolst (list 7 8 10 11 39 40 41 50 51 62 71 72 73))
    (foreach grp dolst
      (setq addto (assoc grp ent))
      (if (/= addto nil)
        (setq new (append new (list (assoc grp ent))))
      )
    )
    (entdel hnd)
    (entmake new)
    (setq itm (1+ itm))
  )
  (princ)
)
Title: attribute text to dtext
Post by: CAB on April 01, 2004, 04:29:55 PM
Oh, I guess I'm seeing double... :shock:
Title: Re: attribute text to dtext
Post by: Rob... on June 18, 2010, 08:30:09 AM
Has this been tested, CAB?
Title: Re: attribute text to dtext
Post by: Rob... on June 18, 2010, 08:51:11 AM
I just tried it out and it seems to be working fine. This is gonna save me a few hours!
Title: Re: attribute text to dtext
Post by: Matt__W on June 18, 2010, 08:55:14 AM
I just tried it out and it seems to be working fine. This is gonna save me a few hours!

I've used that routine before a number of times without any problems.