Jump to content

Recommended Posts

Posted

Please some one help me is there any lisp for convert attribute value to text

note:

1)the value of attributes will remain even if i exploded the block

:cry:

Posted

Are you aware of the command 'burst' that explodes attributed blocks and convert attribute objects to texts?

Posted

And for exisiting attributes

Found somewhere I don't remeber exactly

;Converts attributes (attr. definitions, tags) to plain texts
(defun C:A2T ( / ss ssl i e new grp grplst addg)
 (if (setq ss (ssget '((0 . "ATTDEF"))))
   (progn
     (setq ssl (sslength ss)
    i 0
    )
     (setq grplst (list 7 8 10 11 39 40 41 50 51 62 71 72 73))
     (while (< i ssl)
(setq e (ssname ss i))
(setq ent (entget e))
(setq new '((0 . "TEXT")))
(setq new (append new (list (cons 1 (cdr (assoc 2 ent))))))
(foreach grp grplst
  (setq addg (assoc grp ent))
  (if (/= addg nil)
    (setq new (append new (list (assoc grp ent))))
    )
  )
(entmake new)
(entdel e)
(setq i (1+ i))
)
     )
   (princ "\nNo attribute Selected")
   )
 (princ)
 ) ; defun

  • Like 2
Posted
Alternatively, there is this.

 

Love this one is extremely helpful.

  • 3 years later...
Posted
On 3/5/2017 at 4:11 PM, asos2000 said:

And for exisiting attributes

Found somewhere I don't remeber exactly

 


;Converts attributes (attr. definitions, tags) to plain texts
(defun C:A2T ( / ss ssl i e new grp grplst addg)
 (if (setq ss (ssget '((0 . "ATTDEF"))))
   (progn
     (setq ssl (sslength ss)
    i 0
    )
     (setq grplst (list 7 8 10 11 39 40 41 50 51 62 71 72 73))
     (while (< i ssl)
(setq e (ssname ss i))
(setq ent (entget e))
(setq new '((0 . "TEXT")))
(setq new (append new (list (cons 1 (cdr (assoc 2 ent))))))
(foreach grp grplst
  (setq addg (assoc grp ent))
  (if (/= addg nil)
    (setq new (append new (list (assoc grp ent))))
    )
  )
(entmake new)
(entdel e)
(setq i (1+ i))
)
     )
   (princ "\nNo attribute Selected")
   )
 (princ)
 ) ; defun
 

 

Thanks so much. It worked on my case!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...