Originally Posted by
deheylen690271
I would like to open a drawing in AutoCAD 2018 (MDI), then use a lisp routine that includes the following code:
- (setq Filename "C:\\ProjDir\\NewDwg.dwg")
- (command "-EXPORTTOAUTOCAD" "F" "2000" "" Filename) to save the original to a new drawing.
- (vla-activate (vla-open (vla-item OpenDrawingsCollection (strcase Filename)))) to open the new drawing and make it the active drawing (kudos to Tharwat for helping me with this part).
This all works fine but I want to add the ability to close the original drawing to this routine and I can't figure out how to do it. What I think is happening is that if I close the original drawing before opening the new drawing, the lisp routine closes as well since I'm closing the namespace. But if I open the new drawing first then I think acad.lsp, acaddoc.lsp s::startup, etc. is killing my lisp routine when the new drawing opens.
Does anyone know if I'm right about this and what I want to do is impossible (at least in LISP) or is there someway to have this functionality?
Thanks for any help with this