Identify Layer in Xref

Discussion in 'AutoCAD' started by Jim Keller, Feb 4, 2004.

  1. Jim Keller

    Jim Keller Guest

    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.
     
    Jim Keller, Feb 4, 2004
    #1
  2. Jim Keller

    ffejgreb Guest

    If you have express tools, use xlist.
     
    ffejgreb, Feb 4, 2004
    #2
  3. Jim Keller

    Davmt Guest

    in express>blocks there is an icon for "List Xref/Block Properties". this should be what you need.
     
    Davmt, Feb 4, 2004
    #3
  4. (cdr (assoc 8 (entget (car (nentsel "\nselect nested object: ")))))
     
    Jason Piercey, Feb 4, 2004
    #4
  5. Jim Keller

    Rudy Tovar Guest

    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)

    )
     
    Rudy Tovar, Feb 4, 2004
    #5
  6. Jim Keller

    Jim Keller Guest

    Thanks, Xlist was just what I was looking for.
     
    Jim Keller, Feb 4, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.