Ron, does this do anything to speed it up a bit?
(defun c:matchxrnametofilename (/ *acad *dwg* blocks xrefs names)
(setq *acad (vlax-get-acad-object)
*dwg* (vla-get-activedocument *acad)
blocks (vla-get-blocks *dwg*)
)
(vlax-for
i blocks
(if (= (vla-get-isxref i) :vlax-true)
(setq xrefs (append xrefs (list i)))
)
)
(setq names (mapcar
'(lambda (x / p pos)
(setq p (vla-get-path x))
(if (setq pos (vl-string-position 92 p 0 t))
(setq p (vl-filename-base (substr p (+ 2 pos))))
(setq p (vl-filename-base p))
)
)
xrefs
)
)
(mapcar
'(lambda (x y)
(vl-catch-all-error-p
(vl-catch-all-apply
'vla-put-name
(list x (vl-filename-base y))
)
)
)
xrefs
names
)
(mapcar 'vlax-release-object (list blocks *dwg* *acad))
(princ)
)
or is it slower?
I know the two mapcars could be combined, but I wanted to see if it would help to make autocad to one process at a time. Also, I took out vlax-map-collection. I'm not sure if that will disable the function entirely, but if it does, you can probably replace it. Either way, test it how it is or combine the mapcars, but only after figuring out if you need the map-collection. If I understand it correctly, the map-collection is just an activeX mapcar, so my hope is that the mapcars should be fine. Either way, let us know.