Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting the xref file names loaded

Status
Not open for further replies.

cadace

Electrical
Dec 4, 2002
19
0
0
NZ
Is there away of extracting the xref file names loaded in a drawing. So that the file names can be printed on the drawing, say using a field. Is there a system variable that this info is stored in?
 
Replies continue below

Recommended for you

I would use the XREFCTL command and set it to one(1) to create a ASCII log file that will have a .XLG extension. You should be able to modify the ASCII log file, then paste and copy to your drawing.
 
cadace,

I would use "_rtext" from the Express Tools.

The $(xrefs) DIESEL function
RText supports listing Xref files attached to a drawing through the $(xrefs) DIESEL function.

A field isn't working, except You would find a lisp...

Lothar

ADT 2004
ACAD 2002
 
LISP routine

;------------------------------------------------------------------------------
;GETXREFS: Returns a list
;------------------------------------------------------------------------------
(defun GETXREF (/ ABLOCK ACTIVEDOC ITEM THEBLOCKS THELIST YESXREF)
;retrieve a reference to the Active Document
(setq ACTIVEDOC (vla-get-activedocument (vlax-get-acad-object)))
;retrieve a reference to the blocks
(setq THEBLOCKS (vla-get-blocks ACTIVEDOC))
;create an empty list
(setq THELIST '())
;process each block
(vlax-for ITEM THEBLOCKS

;check if it's an Xref
(setq YESXREF (vlax-get-property ITEM 'ISXREF))
;if it is
(if (= YESXREF :vlax-true)
;do the following
(progn
;get the Xref name
(setq ABLOCK (vlax-get-property ITEM 'NAME))
;store it in the list
(setq THELIST (append (list ABLOCK) THELIST))
) ;progn
) ;if
) ;vlax-for
;print the list
THELIST
) ;defun

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Thanks Burgunit
LISP routine worked well, it extracted the xref names as I wanted. Any ideas on how to pull the list into my drawing automaticly so it can be printed?
 
Status
Not open for further replies.
Back
Top