Help - Lisp Code to get file name or path from picked xref

Discussion in 'AutoCAD' started by Ron Meicho, Jul 22, 2004.

  1. Ron Meicho

    Ron Meicho Guest

    I need some help Lisp Code to get actual file name (not the dialogue
    list or block name) or the full path from a "entsel" picked xref. Thanks

    Ron Meicho
    Ron Meicho, Jul 22, 2004
  2. Ron Meicho

    T.Willey Guest

    (defun c:xpath (/ xr1 xr2 xr3 tx1 tb1)

    (if (setq xr1 (entsel "\nSelect Xref. "))
    (setq xr2 (entget (car xr1)))
    (setq tx1 (cdr (assoc 0 xr2)))
    (if (= tx1 "INSERT")
    (setq xr3 (cdr (assoc 2 xr2)))
    (setq tb1 (tblsearch "block" xr3))
    (if (assoc 1 tb1)
    (setq xr-path (cdr (assoc 1 tb1)))
    (prompt "\n Block is not an Xref. ")
    ); if
    ); progn
    (prompt "\n No Block or Xref selected.")
    ); if
    ); progn
    (prompt "\n Nothing selected.")
    ); if
    (princ xr-path)
    ); defun

    This should work.

    T.Willey, Jul 22, 2004
  3. Ron Meicho

    Ron Meicho Guest


    Ron Meicho
    Ron Meicho, Jul 22, 2004
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.