PDA

View Full Version : Remove xdata from an object


ccowgill
2009-04-02, 07:12 PM
This is probably a simple question, and I probably already know the answer, but for some reason my brain isnt working today. Is there a simple way to remove xdata from an object? I need to remove this

(-3 ("WIGHTMANCAD" (1070 . 2)))

from my specific object and I just cant think of how to do it.

rkmcswain
2009-04-02, 07:40 PM
See these threads:

http://discussion.autodesk.com/forums/thread.jspa?messageID=1139348

http://discussion.autodesk.com/forums/thread.jspa?threadID=69446

ccowgill
2009-04-02, 08:02 PM
the post in the second link worked great, thanks.

David Bethel
2009-04-04, 09:07 PM
Maybe something like this:

(defun rxdata (ename)
(entmake (entget ename))
(entdel ename)
(redraw (entlast))
(prin1))

This does alter the handle data. -David

ccowgill
2009-04-06, 03:02 PM
Maybe something like this:

(defun rxdata (ename)
(entmake (entget ename))
(entdel ename)
(redraw (entlast))
(prin1))This does alter the handle data. -David
Welcome to AUGI, and congrats on your first post.
This is the code I ultimately went with:

(defun c:xdatarem (/ ss nm count)
(setq ss (ssget '((0 . "MULTILEADER,MTEXT")))
count 0
) ;_ end of setq
(while (< count (sslength ss))
(setq nm (ssname ss count))
(delxdata nm '("WIGHTMANCAD"))
(setq count (1+ count))
) ;_ end of while
) ;_ end of defun
(defun DelXdata (ent app / entlst tmplst)
(setq entlst (entget ent app))
(foreach memb (cdr (assoc -3 entlst))
(setq tmplst (cons -3 (list (cons (car memb) nil)))
entlst (subst tmplst (assoc -3 entlst) entlst)
entlst (entmod entlst)
) ;_ end of setq
) ;_ end of foreach
) ;_ end of defun