Author Topic: Xrefs contained in drawings  (Read 1523 times)

0 Members and 1 Guest are viewing this topic.

diarmuid

  • Bull Frog
  • Posts: 417
Xrefs contained in drawings
« on: November 13, 2007, 11:19:49 AM »
I have 50 or so drawings that i want to get a list of the xrefs that are attached to these drawings.  Is ther a utility or lisp etc. that is available that could accomadate my request?

Thanks in advance

Diarmuid
If you want to win something run the 100m, if you want to experience something run a marathon

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Xrefs contained in drawings
« Reply #1 on: November 13, 2007, 11:49:48 AM »
Look at the reference manager in start-> Programs->Autodesk-> Autocad (your version)-> Reference Manager

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Xrefs contained in drawings
« Reply #2 on: November 13, 2007, 11:57:01 AM »
You could also run this in a script. It will append xrlist.txt with the root drawing, a count of the loaded xrefs, and their full path and name in the same directory as the drawing:

Code: [Select]
(defun c:xrlist (/ FD FN FNO TXT XRLST)
  (setq fd  (vla-get-filedependencies
      (vla-get-activedocument (vlax-get-acad-object))
    )
fn  (strcat (getvar 'dwgprefix) "xreflist.txt")
fno (open fn "A")
  )
  (vlax-map-collection
    fd
    '(lambda (x)
       (if (= (vla-get-feature x) "Acad:XRef")
(setq xrlst (cons (vla-get-fullfilename x) xrlst))
       )
     )
  )
  (if xrlst
    (progn
      (write-line
(strcat "\nROOT DRAWING: "(getvar 'dwgprefix)
(vl-filename-base (getvar 'dwgname))
)
fno
      )
      (write-line
(strcat (itoa (length xrlst)) " total loaded xrefs: ")
fno
      )
      (foreach xr xrlst
(write-line xr fno)
      )
      (close fno)
    )
  )
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC