;;;GET LAYER NAME
(while (or (not ln)
(not (tblsearch "LAYER" ln)))
(setq ln (getstring "\nLayer Name To Search Block Table For: ")))
;;;SEARCH EACH BLOCK
(while (setq tdef (tblnext "BLOCK" (not tdef)))
(setq bn (cdr (assoc 2 tdef))
fe (cdr (assoc -2 tdef))
lf nil)
(while (and fe (not lf))
(setq ed (entget fe))
(if (= (strcase ln) (strcase (cdr (assoc 8 ed))))
(setq lf T blist (cons bn blist)))
(setq fe (entnext fe))))
;;;PRINT LIST OF BLCOK CONTAINING THE SPECIFIED LAYER
(prin1 blist)
(princ))
;|
1 gotcha is if a block contains the LAYER table definition but does not have
any entities referencing this layer. An empty layer. -David
"keithk" <kkac...@yahoo.com> wrote in message
news:f04e9...@WebX.maYIadrTaRb...
> I've got a drawing that has a layer called "TR" in it. Some how a block in
referenced to this layer and I don't know which one. Is there a way lisp can
scan all the blocks in this drawing and see which one(s) is referenced to
this layer? Any help would be appreciated.
> Keith
>
>
> Layer Name To Search Block Table For: tr
> nil
>
"keithk" <kkac...@yahoo.com> wrote in message
news:f04e...@WebX.maYIadrTaRb...
> Doesn't do anything. Below is what it gives me in the command line.
> FINDLAYER
> Command:
> Command:
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.252 / Virus Database: 125 - Release Date: 5/10/01