Author Topic: apply auto lisp to nested blocks (blocks sub entities)  (Read 1682 times)

0 Members and 1 Guest are viewing this topic.

handasa

  • Newt
  • Posts: 21
apply auto lisp to nested blocks (blocks sub entities)
« on: February 09, 2016, 08:27:57 AM »
Code - Auto/Visual Lisp: [Select]
  1.     ;Change all TrueColor to AutoCAD Color Index
  2.     (defun c:all_to_aci ( / remove420 la e)
  3.       (defun remove420 (entity_list)
  4.         (entmod (vl-remove (assoc 420 entity_list) entity_list))
  5.         )
  6.       (while
  7.         (setq la (tblnext "layer" (not la)))
  8.         (remove420 (entget (tblobjname "layer" (cdr (assoc 2 la)))))
  9.         )
  10.       (while (setq e (if e (entnext e) (entnext)))
  11.         (remove420 (entget e))
  12.       )
  13.       (princ)
  14.     )



i want this lisp to be applied to all objects including nested blocks entities...

any help?
thanks in advance...

ChrisCarlson

  • Guest
Re: apply auto lisp to nested blocks (blocks sub entities)
« Reply #1 on: February 09, 2016, 09:52:50 AM »
You'll find that almost all of these questions have been answered

https://www.theswamp.org/index.php?topic=5288.0

Also stealing snippets are bad, a quick google search will bring up a post from 2014 by Stefen that you lifted this routine from.

http://www.cadtutor.net/forum/showthread.php?88740-Change-especific-True-color-to-especific-ASC-color-by-LISP&p=608427&viewfull=1#post608427

Please provide proper credits in your routines.

handasa

  • Newt
  • Posts: 21
Re: apply auto lisp to nested blocks (blocks sub entities)
« Reply #2 on: February 09, 2016, 12:07:10 PM »
iam not a lisp developer ... and i didn't say that this lisp is mine !
i found this lisp and wanna to modify it to meet my needs ...
best regards

ChrisCarlson

  • Guest
Re: apply auto lisp to nested blocks (blocks sub entities)
« Reply #3 on: February 10, 2016, 07:27:34 AM »
Anyway, check out the 3rd post in the first link I posted. It shows how to go into the block and apply a change, in the case of the other thread he changed all the colors to color index #8.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: apply auto lisp to nested blocks (blocks sub entities)
« Reply #4 on: February 10, 2016, 07:52:13 AM »
The OP has posted this problem 3 times (2x on this forum):
https://www.theswamp.org/index.php?topic=50890.msg560253#msg560253