File Exchange vs. File Open

MicroStation® is a 3D/2D computer-aided-design (CAD) tool from Bentley Systems, Inc.. The MicroStation Development Library (MDL) provide a huge range of functions that deal with exotic 3D object manipulation. Other functions deal with more mundane operations, such as opening a file. However, MDL provides several ways to open a file.

The most intuitive way is to open a file, like any other application, and restore its state as it was last saved. In other words, what you saw the last time you working on a particular file is what you see when you open that file once more.

The less intuitive way, but invaluable from the user point of view, is to perform a file exchange. This operation requires that a file be already open, with one or more references attached (A reference is another file opened read-only and viewed concurrently with the editable file. It's a common MicroStation idiom). The file exchange swaps the active file with a nominated reference file. After the file exchange, the previously active file is a reference, and the previously referenced file is the active, editable file. The essence of the file exchange is that the view of the file(s) is the same afterwards as before.

The tables below list file open and file exchange functions available in the MDL for MicroStation V8.

MicroStation V8 provides multiple models per file and the later functions reflect that. MicroStation V8's predecessor, MicroStation/J (also known as V7), did not provide multiple models. For V7, only mdlSystem_exchangeDesignFile and mdlSystem_newDesignFile were available.

File Exchange

There are several functions for file exchange. File exchange requires that a DGN file be open, so it can't be used when starting MicroStation.

The essence of file exchange is that it preserves the current view settings. The difference is that the active model is changed. mdlSystem_newDesignFile opens a DGN file using its last saved settings, including view settings.  Depending on the state of the current view settiings and the saved view settings, the user may see dramatically different graphics when using file exchange rather than opening a new file.

File Exchange Functions
Function First Available
mdlSystem_exchangeDesignFile MicroStation V8.0
mdlSystem_exchangeDesignFileAndModel MicroStation V8.9.2
mdlSystem_exchangeToReference MicroStation V8.9.2

The first mdlSystem_exchangeXxx function is compatible with MicroStation V7 and exchanges the default model.  The latter two are more useful in the V8 era when working with models and model references and you want to exchange with a specified model.

File Open

File Open Functions
Function First Available
mdlSystem_newDesignFile MicroStation V8.0
mdlSystem_newDesignFileAndModel MicroStation V8.5

As documented, the file open functions reinitialize most of MicroStation. Each clears the state functions, reads the type 9 and 66 elements and initializes the Terminal Control Block (TCB) accordingly, and resets all undo pointers. They also place queue elements in the input queue and invoke MicroStation's queue processing loop. Those actions contrast with file exchange, when MicroStation is already initialized.