#$%*@ - XDATA

Discussion in 'AutoCAD' started by Rad_Cadder, Aug 20, 2004.

  1. Rad_Cadder

    Rad_Cadder Guest

    HELP!!!
    I have setup all text edit routines used by our designers to add xdata to all text and blocks.
    I then setup a routine to change text and blocks containing that xdata to a different layer and color
    so that our drafters can check formatting.

    Problem: "HOW DO I GET RID OF XDATA ONCE I AM FINISHED WITH IT???"

    I have looked everywhere I can think and have not seen anything about removing xdata???
     
    Rad_Cadder, Aug 20, 2004
    #1
  2. Rad_Cadder

    Jürg Menzi Guest

    Hi Rad_Cadder

    This funktion does what you want:
    Code:
    (defun MeDelXdata (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)
    )
    )
    (cdr (assoc -1 EntLst))
    )
    
    Use:
    (MeDelXdata Ename '("*"))
    Deletes all Xdata from 'Ename'. If you wanna use the function for multiple
    Entities:
    Code:
    (defun C:DelXdata ( / CurEnt CurSet)
    (if (setq CurSet (ssget (list '(0 . "INSERT,TEXT,MTEXT") '(-3 ("*")))))
    (while (setq CurEnt (ssname CurSet 0))
    (MeDelXdata CurEnt '("*"))
    (ssdel CurEnt CurSet)
    )
    )
    (princ)
    )
    
    Cheers
     
    Jürg Menzi, Aug 20, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.