How can my design files (DGN) be automatically backed up so my file can be retrieved if any sort of corruption occurs to it?
An MDL called "backup.ma" had previously been compiled for use in older versions of MicroStation which no longer seems to work in the current releases of V8i. This allowed for backups of your design files (DGN) to the folder defined using the configuration variable MS_BACKUP and various other settings. A simple method is required that allows for the automatic backup of the design file either when the file is opened, closed or both.
AskInga - Run a VBA Macro when opening or closing design files
Instructions are included on how to set this up so this macro AutoLoads.
You will see in the instructions that it has been setup to run specific key-ins when a design file is opened or closed. To change the key-ins used here just follow these instructions:
1. Open VBA Project Manager from > Utilites > Macros > Project Manager.
2. The "AutoRun" project should already be listed here and set to "AutoLoad".
3. Double-click on this and it will list the macros available in this project.
4. Select "OnProjectUnload" and click on the "Edit" button.
5. This will open the VB Macro in the "Visual Basic Editor".
6. To the left you will see "Modules" and "Class Modules". Expand both by clicking on the "+" sign.
7. You will then see "clsDGNOpenClose", double click on the item.
8. If you scroll down to the bottom of the central screen you will see a list of commands starting with "CadInputQueue.SendCommand". These have all of the key-ins listed that will run when opening or closing the file.
9. Edit the command at the bottom from:
CadInputQueue.SendCommand "Reference Detach All"
To:
CadInputQueue.SendCommand "Backup"
10. You can also change the commands for "OnDesignFileOpened" to whatever you like.
From:
CadInputQueue.SendCommand "View Off All" 'Turn off all views
CadInputQueue.SendCommand "View On 1" 'Turn View 1 on
CadInputQueue.SendCommand "Window Tile" 'Resize View 1 to fit screen
CadInputQueue.SendCommand "Fit All" 'Start Fit All command
CadInputQueue.SendCommand "Selview 1" 'Apply to View 1
To:
CadInputQueue.SendCommand "Fit All"
11. Close Microstation and start it up again to get the VB macros working.
When you open a design file or close a design file it will perform these key-ins. That is, it should produce a backup file in the MS_BACKUP folder when you close the design file.
Other language sources:
Français
Deutsch