Hi,
I have searched everywhere but still could not find an answer that worked for me.
Basically I batch export a group of DGN files into DXF. I control microstation from a powershell script using .NET.
These are the steps:
1) Run vba optimization script
2) Discard all changes (Key in 'UNDO ALL NOCONFIRM')
3)Application.ActiveDesignFile.Close
And yet, despite using the 'UNDO ALL NOCONFIRM", which should get the file back to its original state, I still get the question "Do you want to save the changes..."?Not acceptable for batch processing where all happens in the background.
What am I missing? Thanks in advance for any ideas
Unknown said: Discard all changes (Key in 'UNDO ALL NOCONFIRM') Application.ActiveDesignFile.Close
Discard all changes (Key in 'UNDO ALL NOCONFIRM') Application.ActiveDesignFile.Close
The key-in is not executed immediately: rather, it is pushed on to MicroStation's input queue. A command in that queue won't be executed until the queue is empty and MicroStation is idle.
The method Application.ActiveDesignFile.Close is executed immediately. It 'overtakes' any command(s) in the input queue. Thus, UNDO ALL NOCONFIRM hasn't been seen at the time the DGN file is closed.
Application.ActiveDesignFile.Close
UNDO ALL NOCONFIRM
The simplest cure is to substitute the equivalent key-in for Application.ActiveDesignFile.Close (CLOSE DESIGN). That way, the sequence of events should be what you expect it to be.
CLOSE DESIGN
Regards, Jon Summers LA Solutions
Answer Verified By: Beatriz S