XREF LAYERS

Discussion in 'AutoCAD' started by ADK, Jan 20, 2005.

  1. ADK

    ADK Guest

    Other than XLIST, are there any other lisp routines that will list the layer
    of a entity which is selected within a XREF (without opening the XREF or
    using reference edit)? I can not use reference edit because we are using
    Autoplant (a database file is associated with the model and is not opened
    unless the model is opened directly in its own session).

    XLIST is giving me layer 0 for entities I know are not layer 0. Within that
    same xref, there are entities that are listed correctly.

    -ADK
     
    ADK, Jan 20, 2005
    #1
  2. ADK

    Jim Claypool Guest

    (defun c:getlayer ( / ent layername)
    (setq ent (nentsel "\nSelect Object on XREF: "))
    (if (> (length (nth 3 ent)) 1)
    (setq layername (cdr (assoc 8 (entget (car (nth 3 ent))))))
    (setq layername (cdr (assoc 8 (entget (car ent)))))
    )
    (print layername)
    (princ)
    )
     
    Jim Claypool, Jan 21, 2005
    #2
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.