Author Topic: remove xdata from a single entity  (Read 1449 times)

0 Members and 1 Guest are viewing this topic.

curmudgeon

  • Newt
  • Posts: 194
remove xdata from a single entity
« on: December 18, 2012, 05:46:44 PM »
Greetings.

I have been reading through past posts, and Gile's program is beautiful.
It's just way more than I can get my head around.

Lee posted
Code: [Select]
(entmod (list (cons -1 entity) (list -3 (list appID))))but I can't get that to work for me. As near as I can tell, entmod will not touch anything under the -3 group code.

All I am really trying to do here is experiment - and I would be more comfortable if my xdata additions could be wiped out more or less globally from my test drawing. I can grab the entities, save the list, delete the original, and create a new copy:

Code: [Select]
(entmake '(
;;; (-1 . <Entity name: 1a5e498>)
  (0 . "LINE")
;;;  (330 . <Entity name: 1a534f8>)
;;;  (5 . "13F0B")
  (100 . "AcDbEntity")
  (67 . 0)
  (410 . "Model")
  (8 . "brick_trim")
  (100 . "AcDbLine")
  (10 1149.64 3400.88 0.0)
  (11 1297.64 3400.88 0.0)
  (210 0.0 0.0 1.0)
;;;  (-3 ("pwr_dev" (1070 . 0)
;;; (1070 . 0)
;;; (1000 . "0")
;;; (1070 . 1)
;;; (1000 . "X")
;;;      )
;;;  )
))

But is there something a little neater?   :-o

Thanks.
Never express yourself more clearly than you are able to think.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

curmudgeon

  • Newt
  • Posts: 194
Re: remove xdata from a single entity
« Reply #2 on: December 18, 2012, 10:04:57 PM »
Many thanks Charles.
That was along the lines I was thinking of.
Never express yourself more clearly than you are able to think.

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: remove xdata from a single entity
« Reply #3 on: December 18, 2012, 11:57:01 PM »
Try this function ..
Code - Auto/Visual Lisp: [Select]
  1. (defun RemoveXdata (ent / app)
  2. ;;; Tharwat 19. Dec. 2012 ;;;
  3.   (if (eq (type ent) 'ENAME)
  4.     (if (setq app (assoc -3 (entget ent '("*"))))
  5.       (entmod (append (entget ent) (list (list -3 (list (car (cadr app)))))))
  6.     )
  7.   )
  8.   (princ)
  9. )
  10.  

Lee Mac

  • Seagull
  • Posts: 12924
  • London, England
Re: remove xdata from a single entity
« Reply #4 on: December 19, 2012, 08:16:24 AM »
Here is a short tutorial demonstrating how to add & remove xdata for multiple applications from an entity:

http://www.cadtutor.net/forum/showthread.php?74884-Filtering-options-for-XDATA-application-names&p=507243&viewfull=1#post507243