Results 1 to 2 of 2

Thread: Lisp file to delete All Xdata from selected entities regardless app name

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2013-09
    Posts
    1
    Login to Give a bone
    0

    Default Lisp file to delete All Xdata from selected entities regardless app name

    Dear Programmers,
    i found many lisp files deleting xdata but what i'm looking for is different.
    i need Lisp file to delete All Xdata from selected entities "multi select" regardless app name

    this one delete all xdata from the drawing at once . i need just to add for selection set , not one entity and not all the drawing

    Code:
    (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)
    )
    )
    )
    
    (defun C:delAllXdata ( / curass countr)
    (setq curass (ssget "X" '((-3 ("*"))))
    countr 0
    )
    (if curass
    (repeat (sslength curass)
    (DelXdata (ssname curass countr) '("*"))
    (setq countr (1+ countr))
    )
    )
    (princ)
    )
    Thank you for your cooperation
    Last edited by Jmurphy; 2015-06-28 at 05:10 PM.

  2. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Lisp file to delete All Xdata from selected entities regardless app name

    Have you tried :

    Code:
    (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)
    )
    )
    )
    
    (defun C:delSelXdata ( / curass countr)
    (setq curass (ssget "_:L" '((-3 ("*"))))
    countr 0
    )
    (if curass
    (repeat (sslength curass)
    (DelXdata (ssname curass countr) '("*"))
    (setq countr (1+ countr))
    )
    )
    (princ)
    )

Similar Threads

  1. Delete XData with a specified application name from a selected entity
    By peter in forum Bridging the Gap: LISP -> .NET -> LISP
    Replies: 6
    Last Post: 2015-06-09, 03:10 PM
  2. Create a Legend from Selected Entities
    By Wish List System in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2013-10-27, 04:01 AM
  3. Delete duplicate entities
    By daniel.144778 in forum AutoCAD General
    Replies: 4
    Last Post: 2008-05-30, 04:10 PM
  4. Replies: 1
    Last Post: 2007-06-06, 10:25 PM
  5. Replies: 1
    Last Post: 2006-04-23, 06:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •