I have a couple of thousand drawings that I need to change the front portion of the xref path from something like "S:\job\proj\for\..." to "S:\boj\jorp\jak\.... The current path or partial path I want to replace can set in a variable and the replacement string can be in a varialble. I have pasted some nice code I found on the forum and I can get it to actually find the path for the xrefs. What I can not do is figure out how to either entmod or vla-put and change it. I sure do wish there was a good book or something that explained how to program with the VLA- functions. Hopefully somebody will know how to do this and it be a piece of cake. Everytime I get awesome help from AUGI I buy another sweatshirt and this will definitely qualify. I already have 3 so maybe we need different color sweatshirts. Thanks to everyone and to whomever can modify this to work as it will be highly appreciated.
Code:
(defun c:jd (/ *blks* ref xname)
(vl-load-com)
(setq nxrp "C:\$temp")
(setq blks
(vla-get-Blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
)
(vlax-for item blks
(if (eq (vla-get-IsXref item) :vlax-true)
(progn
(setq ref (tblsearch "BLOCK" (setq xname (vla-get-Name item))))
(if (eq (logand (cdr (assoc 70 ref)) 32) 32)
(setq xx (vla-get-path xname))
(vla-put-textstring nxrp xx)
)
(setq refpath (cdr (assoc 1 ref)));current xref path
);progn
);if
);vlax
; (vl-cmdf "-Image" "D" "*")
(princ)
)