Identify Layer in Xref

Jim Keller

Usenet Archive
Joined
Jan 28, 2004
Messages
6
Reaction score
0
Has anyone come across a way to select an object in an external reference and have that entity return the layer it is on. I can turn off layers by selecting objects in an xref, and then undo, but was wondering if there was a better method.
 
in express>blocks there is an icon for "List Xref/Block Properties". this should be what you need.
 
You might also want to consider paperspace layer freeze and if current set to a different layer.

See below

(defun c:fxl (/ ent inf ct-con t-con o-con)

(prompt "\nselect entity in xref....")

(setq ent (nentsel))

(if ent

(progn

(setq inf (entget (car ent)))

(setq ly (cdr (assoc 8 inf)))

)

)

(if (and ent (not (= ly "0")))

(progn

(if (= (getvar "tilemode") 1)

(progn

(if (= ly (getvar"clayer"))

(progn

(setq ct-con (tblsearch "layer" "0")

t-con (cdr (assoc 70 ct-con))

o-con (cdr (assoc 62 ct-con))

)

(if (= t-con 1)(command "layer" "t" "0" ""))

(if (< o-con 0)(command "layer" "on" "0" ""))

(setvar"clayer" "0")

)

)

(command "layer" "f" ly (princ))

(prompt (strcat "\nlayer frozen is " ly))

)

)

(if (= (getvar "tilemode") 0)

(progn

(command "vplayer" "f" ly "c" "")

(prompt (strcat "\ncurrent vport layer frozen is " ly))

)

)

)

)

(if (= ly "0")(xl))

(princ)

(setq ly nil)

(if ent (c:fxl))

(princ)

)

(defun xl (/)

(if ent

(progn

(setq ent (reverse ent))

(setq inf (entget (car (car ent))))

(setq ly (cdr (assoc 8 inf)))

(if (and (= (getvar"tilemode") 1)(not (= (getvar"clayer") ly)))

(progn

(command "layer" "f" ly (princ))

(prompt (strcat "\nlayer frozen is " ly))

)

)

(if (= (getvar"tilemode") 0)

(progn

(command "vplayer" "f" ly "c" "")

(prompt (strcat "\ncurrent vport layer frozen is " ly))

)

)

)

)

(setq ly nil)

(princ)

)
 

Latest threads

Back
Top