[V8i SS3] Avoid auto cell renaming when saving to DWG

Need a solution how to avoid automatic renaming of duplicate cells. The cell in attached file UDVENT is correctly created using ByLevel/ByCell attributes but still when converting DGN (normal) cells to DWG(shared cells) it is renamed to UDVENT1, UDVENT2, etc. This is wrong behavior as cell geometry is identical. ByLayer/Byblock symbology is AutoCAD compatible so cells shouldn't be renamed.

Even if cells are different there is need to avoid automatic renumbering and ask user how to solve this issue. MS_RESOLVESCNAMECONFLICT variable doesn't help in this case.

CellNameConflict2DWG.dgn

  • What you have done in your desired DWG file is to have re-designed your normal cells in file - you have changed the levels of the circle and line elements of both normal cells to level "0". This result has the same effect as to the workflow of prompting you on the level conflict - in this case you'd have selected level "0". By changing levels of all the elements in a cell to level "0", you certainly have resolved the level conflict across multiple cell definitions. While this level change works for you, I suspect it to work for all users. It is not just level - tag, line style, fill color, etc, are all needed to be compared and resolved before a cell definition can be shared. I'm not sure how a configuration variable can really help in resolving all of these conflicts. I'm thinking perhaps a new option in DWG Save As may help: a new option that allows user to create single block from duplicated cells without checking for conflict at all, i.e. simply assume all cells under the same name are identical. When this option is turned on, all normal cells having the same name will be using the same shared cell definition after saved as DWG. This option would have an effect of "first come first serve" - the first cell in file would win. All other cells would share the same definition of the first cell found in the DGN file. This option would work for your case, and perhaps as well as some other user's cases. But an obvious drawback is that, when you get a DGN file you do not know for sure that all normal cells having the same name indeed can be shared with a same definition, you risk to create a DWG file with unexpected shared cells.



  • If both cells must be converted to one single shared cell definition, which is essentially what DWG save has to do, only on level can be used. It is not obviously to me which one to be correct.


    Both levels are correct. See CellNameConflict-expected-result.dwg file for expected result when saving to DWG. Shared cells are unmanagable in DGN environment, cause lot of issues and would like to avoid using them.

    Regarding prompting users to resolve conflicts I would expect that MS_RESOLVESCNAMECONFLICTS or similar variable would be honored when saving to DWG. Need something like MS_RESOLVENCNAMECONFLICTS (where NC stands for Normal Cell) variable to control how to resolve conflicts. But I see that it could be a more complex task when saving as require to compare which normal cells are identical and could be merged as one SharedCell and which are not.

    CellNameConflict-expected-result.dwg

  • ByLevel/ByBlock is not the cause of renaming - it is actual levels that are different. The elements in one cell are on level 1_UDTK_ELEM_VENT_####_#, but those in the other cell are on level 2_UDTK_ELEM_VENT_####_#. If both cells must be converted to one single shared cell definition, which is essentially what DWG save has to do, only on level can be used. It is not obviously to me which one to be correct. You are right that prompting you to select a correct level resolves the conflict for this particular file, which has only two cells. But I suspect that it may apply to general cases, files with lots of different levels, different colors, tags, etc, etc. Prompting users to resolve conflicts during a save as process, worse yet during a batch conversion, is unlikely a welcome solution. Keeping content unchanged but renaming them is on the safe side. At least cells can display correctly after the conversion. In your particular case, if you can create shared cells prior to saving as DWG, that would be the best way around this problem. Because you would know exactly which level to use for elements in a shared cell definition. When you create the cell definition, you just need to turn on the toggle "Use Shared Cells". Everything else is the same as far as creating a cell goes.