I have a lisp routine that creates a new drawing from the active drawing using EXPORTTOAUTOCAD, then opens it. Since I know the file name (having just created it) I want this drawing to become the active drawing using vla-item. When I run this code:
(setq Filename "C:\\ProjDir\\NewDrawing.dwg")
(vla-item (vla-get-documents (vlax-get-acad-object)) Filename) I get this error:
error: Automation Error. Description was not provided.
This code works just fine however:
(setq Filename "C:\\ProjDir\\NewDrawing.dwg")
(vlax-for dwg (vla-get-documents (vlax-get-acad-object))
(if (= (vla-get-FullName dwg) FileName) (vla-activate dwg)))
Can someone please explain how to use vla-item with a known drawing name to get the vla-object out of the documents collection?
Thanks