In MicroStation, the Replace Cells tool lets you replace a cell in a model or update its definition in a DGN file. You can replace or update an individual cell, groups of cells, or all cells in a model.
Replace Cells lets you replace cells in a DGN file in a particular model. Cells in the model can be replaced by another cell in the model or by one in a cell library.
You have placed the type 2 cell "chair1.cell" in your model (Figure 1), and now you want to replace it with a different cell from a cell library (Figure 2).
Note: A type 2 cell is a normal graphic or point cell that is placed in a DGN file. It is not a shared cell, which means its definition is not stored in the file.
Figure 1 - chair1.cell
Figure 2 - replacement
In the Replace Cells dialog box, set Method to Replace and Mode to Single. If Use Active Cell is off, select chair1.cell, and then select the cell to replace it.
If Use Active Cell is on, make sure the active cell is the one that's to replace chair1.cell. The cell that is being replaced can be selected, and the old chair1 cell is replaced with the new one.
Figure 3 - Replace Cells dialog box
If a cell in the model has been placed more than once, you can replace all the instances of that cell at one time. In the Replace Cells dialog box, set Mode to Global.
When you pick a cell to be replaced, the following alert box appears:
Figure 4 - alert box
When you click yes, all cells with the same name as the active cell are replaced.
In the case of a shared cell, the Global option will replace the shared cell definition, and it will change all the definitions of that cell in the file. The existing shared cell definition will be deleted.
You can also select cells to be replaced using a fence. If a fence has been placed around the cells to be replaced, the Use Fence option will be available in the Replace Cells dialog box.
Figure 5 - Use Fence option
Set Mode to Single to replace only the cells within the fence. If Mode is set to Global, the tool replaces all the cells in the model with the same name as selected cells.
A particular instance of a shared cell cannot individually be replaced by a cell with the same name. This is because the definition of the cell is stored in the DGN file. If the cell definition is updated, all shared cell instances that reference it are affected.
You can replace a shared cell with a cell that has a different name in the cell library. The replacement cell will also be a shared cell and its definition will be stored in the DGN file.
Cells you want to be replaced can also be selected with the element selection tool. Still, Mode must be set to Single to avoid changing all cells with the same name in the model.
When a cell has been modified in the active cell library, the update cell option allows updating the cells in the DGN file to the current version of the cell of the same name in the library. This feature is useful for updating cells in the active file when cell definitions are updated in the library.
Returning to the example using chair1.cell, suppose the cell was shared, so that the definition is stored. After changing the cell in the cell library, the task is now to upgrade the definition in the DGN file.
Figure 6 - making changes to cell directly in a cell library
Use the Replace Cell tool with the mode set to Update. The Replace Cell tool will use a cell with the same name in the active cell library.
Figure 7 - Replace Cell set to Update
Click on a cell and the Replace Cell tool updates its definition in the DGN file to match the definition in the cell library.
Figure 8 - Replace Cell with updated definition
The other settings in the Replace Cell tool have the same effect when using the Update setting as they do when replacing a cell. With the global setting active, all the cells of the same name in the DGN file are updated, and a fence or element selection can be used to pick specific cells to be updated. Updating a shared cell instance will update the definition, which will affect all shared cell instances in the file.
There are additional options that are available in MicroStation V8.
Figure 9 - additional options in MicroStation V8
The Replace Cell tool can also be used from the command line to replace cells in multiple DGN files at one time. This will work only if you are replacing an existing normal cell (type 2) with another normal cell. This does not work for shared cells.
Open the MS-DOS Command Shell (i.e. Windows > Start > Run > cmd) and enter this (without line breaks):
for %f in (C:\CELL\*.DGN) do call "c:\Program Files\Bentley\MicroStation V8i (SELECTseries)\MicroStation\msbatch" repcell.ma %f C:\CELL\CELLV8.CEL Y "CHAIR1" "CHAIR1"
If you have installed MicroStation in the recommended location, it will be installed in the Program Files directory. Since DOS recognizes spaces as a new command, you will need to include the path to the msbatch.bat in quotation marks as seen above.
You must specify a path without spaces when inputting the location of the DGN files that will be processed. The quotation marks that are normally used to read path with spaces cannot be read in conjunction with the parentheses.
The Replace Cells tool cannot be used to replace groups (unnamed cells, also known as orphan cells).
Running the Replace Cell tool in batch process mode will only replace cells in the Default Model. (The model name cannot be specified through the command line.)
Q: When I replace a cell, why is the size different?
A: The cell is replaced at the original size that the cell was placed. Often changing the value of the true scale toggle will help.
Q: Can I replace an existing cell with a totally different cell?
A: Yes, as long as the cell is not shared, you can replace any cell with any other cell from any library.
Why do we miss the cell remapping in the SAVE AS/Options/Remapping?
1. There is also Key-in: "replace cell" which allows to replace cell clicking one by one but beware it deletes user/tag data.
2. "set item toolsettings repcellkeepattributestoggle" is misleading for "replace cells extended" as in GUI it is called replace not keep attributes.
3. There is no "set item toolsettings " key-in for choosing replace method or mode so batch process without using macro not possible.
4. Not possible to replace shared cells so shared cells are still hard to use and not user-friendly.
Figure 10 - MS-DOS Prompt is not helpful. Enter what into the prompt? It's not legible? Type out the command so we can read it instead of doing a screen capture that is too small to read.