Lisp + Script + Multiple dwgs in MDI mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Now I know I probably could modify my approach to a benchmark tool I've used over the last, well... 8 years now. But I really would rather not. In this benchmark tool I wish to load Trimble PipeDesigner3d as it is very much apart of our workflow.
The benchmark tool runs through, nearly to completion uninterrupted and without user involvement opening 5 drawings in (the default) MDI mode, in each, the script is running none stop and continues even as each of the drawings is opened. As each drawing is opened a SaveAs to another name is scripted. After the SaveAs, in each drawing, the script xrefs in 6-8 drawing files and perform a number of automated commands along the way. (At the end of each 'group' of commands I capture the time since the previous 'group' of commands and report it to a csv file.)
At the end, after roughly 40+or- minutes each drawing that was previously saved before moving to the next drawing is closed. Normal expected AutoCAD behavior would ordinarily be that you could proceed to close the drawing without AutoCAD thinking that the drawing changed in some way. However, AutoCAD asks if you want to save the changes. Indeed, there are no changes, however, Trimble PipeDesigner for some reason imposes some kind of edit on the drawing so that now it asks if you want to save changes.
Now, as I said... I probably could modify the approach to set SDI = 1 and run the benchmark in Single Document Mode... but I would rather not. Yes, at the end of the script to close the drawings and shut down AutoCAD automatically I run the 'QUIT' command. This is what closes all the drawings... but I believe that since PipeDesigner edits the drawing in some way, it asks if you want the drawing saved...
Now the Script that seems to move on just fine in MDI going forward... has no action in each of the drawings as they, one by one now have the focus, but close (by virtue of the 'QUIT' command.
I trust I've explained this well enough to show what is being done.
I am wondering if anyone has a thought as to how I might impose one last save on each drawing as it gains focus on its way to being closed. I know I could do 'SAVEALL' command and that should be enough to save any change, but as soon as the next drawing gains focus just after the previous drawing is closed, PipeDesigner want to impose an edit on the drawing.
Thoughts? (.NET I presume... however this is not an option at the moment due to the learning curve and time to learn)
Been doing lisp and scripts for quite some time now.