Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

make xref name as xref file name

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
787 Views, 5 Replies

make xref name as xref file name

I have some drawing's with huge amount of xref's but many of them have not same names as external xref file name. Example: internal xref name "arch-290612" connected to external file name "arh-231213" and so on..

How can I make xref name equal to external file name "all an once" per one lisp session (need lisp programm for it)?

5 REPLIES 5
Message 2 of 6
hmsilva
in reply to: Anonymous

As a 'demo' 

 

(vl-load-com)
(defun c:demo (/ 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) )

 

 

Hope that helps

Henrique

EESignature

Message 3 of 6
Anonymous
in reply to: hmsilva

Henrique You are real Master. Works Perfect!
Message 4 of 6
hmsilva
in reply to: Anonymous

Glad it worked for you.

Henrique

EESignature

Message 5 of 6
darrell.l.gregg
in reply to: hmsilva

just what I was looking for!

Message 6 of 6
hmsilva
in reply to: darrell.l.gregg

Hi Darrel,
I'm glad it's useful for you!

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost