Error when selecting a conduit: An item with the same key has already been added

Product(s): StormCAD, SewerCAD, SewerGEMS, CivilStorm
Version(s): CONNECT Edition
Area: Modeling

Problem

When selecting a conduit in a model, the following error is generated: 

11/16/2018 20:59:26.86 System.ArgumentException: An item with the same key has already been added.

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Haestad.StormSewerProduct.EditorModel.Domain.GenericStormSewerDomainElementEditorModelBase.IntializeSupportedResultFieldDefinitions(FieldCollection aresultFieldCollection)
at Haestad.StormSewerProduct.EditorModel.Domain.GenericStormSewerDomainElementEditorModelBase.InitializeFieldDefinitions()
at Haestad.Framework.Adapting.DomainElementEditorModelBase..ctor(String name, Int32 elementTypeID, IModelingElementManager manager, NumericPresentationManager npm, DomainElementEventChannel channel, UndoManager undomanager, IDomainProject project)
at Haestad.StormSewerProduct.EditorModel.Domain.GenericStormSewerDomainElementEditorModelBase..ctor(String name, Int32 elementTypeID, IModelingElementManager manager, NumericPresentationManager npm, DomainElementEventChannel channel, UndoManager undomanager, IDomainProject project, IGraphicalParentFormUIModel parentFormUIModel, ModelingElementEventChannel modelingElementEventChannel, ScenarioEventChannel scenarioEventChannel)
at Haestad.StormSewerProduct.Support.Application.StormSewerProductEditorModelFactory.PropertyGridEditorModelFor(DomainElementType atypeElement, Int32 aintId, IProject project)

...

Solution

First, make sure you are using the latest version of the storm-sewer product. One instance when this issue occurred only happened in the first CONNECT Edition release. Upgrading to the latest version did not generate the error.

If that doesn't help, try the following. First, close the model but leave the product open. Go to File > Database Utilities > Compact Database. Select the database file associated with the model and when prompted, select the option to purge the model to save space. Then open the model and see if the error still occurs.

If it does, close the model again. Open File Explorer and browse to where the model file is saved. Create a new folder and copy just the .stsw and .stsw.sqlite files into the new folder. Then open the model from the new folder location.

If that doesn't help, go to File > Import > (product name) database. If there is an issue with the .stsw file, this can help.

See Also

Error computing model: "Calculation cancelled by user" OR "Specified cast is not valid" OR "An item with the same key has already been added"

  • Created by Bentley Colleague
  • When: Wed, Nov 21 2018 8:36 AM
  • Revisions: 1
  • Comments: 0
Anonymous
Recommended
Related