@DC-MWA wrote:
After I do the copying of the files, I then open the savedas drawing and rename all the images to "X-imagename" and remove the paths.
Is this something we could do or should I start another post?
Sure we can.
BTW please ignore the post #4 as i tried to modify it and i run out of time
This version will save the drawing on the selected folder where the new renamed images are located
(defun c:copydwgimages (/ aDoc ss i image file images)
(vl-load-com)
(setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(if
(and
(setq ss (ssget "X" '((0 . "IMAGE"))))
(setq i 0)
(repeat (sslength ss)
(setq image (vlax-ename->vla-object (ssname ss i))
file (vla-get-imagefile image)
i (1+ i)
)
(if (not (assoc file images))
(setq images (cons (list file image) images))
)
images
)
(setq dir-loc (acet-ui-pickdir "Select Files to XREF"))
)
(progn
(Vla-saveas
aDoc
(strcat dir-loc "\\" (Vla-get-name aDoc))
)
(foreach itm images
(setq NameAndPath (car itm))
(vl-file-copy
NameAndPath
(strcat dir-loc
"\\"
"X-"
(setq xname (vl-filename-base NameAndPath))
(vl-filename-extension NameAndPath)
)
)
(vla-put-name (cadr itm) (strcat "X-" xname))
(vla-put-imagefile
(cadr itm)
(strcat ".\\"
(strcat "X-" xname)
(vl-filename-extension NameAndPath)
)
)
)
)
)
(princ)
)
HTH