(vl-load-com)
(defun c:exn (/ name)
(vlax-For blk (vla-Get-Blocks
(vla-Get-ActiveDocument (vlax-Get-Acad-Object))
)
(if
(and
(= (vla-Get-IsXref blk) :vlax-True)
(not
(wcmatch (vla-get-Name blk)
(setq
name (vl-filename-base (setq path (vla-get-path blk)))
)
)
)
)
(if
(not
(vl-catch-all-error-p
(vl-catch-all-apply '(lambda () (vla-put-Name blk name)))
)
)
(vla-reload blk)
)
)
)
(princ)
)
(c:exn)

Saved from:
http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-xref-name-as-xref-file-name/td-p/5437287

Advertisements