Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to find out what entinty is using a layer

0 views
Skip to first unread message

David Bethel

unread,
May 16, 2001, 5:15:39 PM5/16/01
to

(defun c:findlayer (/ lf bn ln tdef fe ed blist)

;;;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
>
>

David Bethel

unread,
May 17, 2001, 1:18:03 PM5/17/01
to

Did the thing word wrap when cut & paste?

> 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

Findlayr.html
0 new messages