Error when importing submodel into target mode: Object reference not set to an instance of an object

Product(s): SewerGEMS, CivilStorm, SewerCAD, StormCAD, WaterGEMS, WaterCAD, HAMMER
Version(s): CONNECT Edition
Area: Layout and Data Input

Problem

An error message is generated after importing a submodel into a target model. The error details are below:

08/27/2018 08:06:26.53 System.NullReferenceException: Object reference not set to an instance of an object.

at Haestad.Mapping.Support.ReferencedFieldFormatter.GetDisplayValue(Object avalue)
at Haestad.Mapping.Support.FieldFormatter.GetFullDisplayValue(Int32 elementId)
at Haestad.Mapping.Support.ElementSymbologyAnnotationDefinitionManager.WriteAnnotationText(ElementSymbologyAnnotationDefinition annotationDefinition, ValuesForFields valuesForFields, Int32 aselectedElementIdsCount, HmIDCollection aselectedElementIds, IFieldFormatter afieldformatter, Boolean requiresNullForMarshallingStrings, Boolean addEmpty, Int32Collection aidCollection, Int32Collection alengthCollection)
at Haestad.Mapping.Support.ElementSymbologyAnnotationDefinitionManager.ApplyAnnotation(IDomainProject project, ElementSymbologyAnnotationDefinition annotationDefinition, HmIDCollection& elementIds, IFeatureAnnotationManager featureManager, IDomainElementManager manager, AnnotationActionType action, HmIDCollection allElementIds)
at Haestad.Mapping.Support.ElementSymbologyAnnotationDefinitionManager.AddAnnotation(IDomainProject project, Int32 elementTypeID, HmIDCollection elementIds, IFeatureAnnotationManager featureManager, IDomainElementManager manager)
at Haestad.Mapping.Support.ElementSymbologyManagerCollection.UpdateSymbology(DomainElementsChangedEventArgs e, IDomainElementManager manager, IFeatureManager afeaturemanager)
at Haestad.Drawing.Domain.DrawingSynchronizerBase.UpdateAddedSymbology(Int32 elementTypeID, HmIDCollection aelementids, IDomainElementManager manager, IDomainProject project)
at Haestad.Drawing.Domain.DrawingSynchronizerBase.SynchronizePolygonDrawingObjectsFromManager(IDomainElementManager amanager, BatchFeatureTransactionType atransactiontype, IDomainProject project, Int32 scenarioId)
at Haestad.Drawing.Domain.DrawingSynchronizerBase.ExecuteImpl(BatchFeatureTransactionType atransactiontype, IDomainProject project, Int32 scenarioId, Int32 symbologyDefinitionId)
at Haestad.Drawing.Domain.DrawingSynchronizerBase.Execute(BatchFeatureTransactionType atransactiontype, IDomainProject project, UInt32 drawingTotalNumberOfOpens)
at Haestad.Drawing.Domain.LayoutControllerBase.ImportFromDatabase(IGraphicalProject aproject, IProgressIndicator aprogressindicator)
at Haestad.Drawing.Control.Application.GraphicalParentFormModelBase.ReloadLayoutController(IProgressIndicator aprogressindicator)
at Haestad.Drawing.Control.Forms.GraphicalDrawingParentForm.ImportSubmodel()
at Haestad.Drawing.Control.Forms.GraphicalDrawingParentForm.ImportSubmodels()
at Haestad.Framework.UI.Integration.RibbonUICommand.InvokeCommand(Object parameter)

Solution

First, try compacting the database for the submodel and the target model, then try the submodel import again.

If that doesn't help, try importing the combined model's database file into a new project. You can do this by going to File > Open, then changing the file type to the database file and selecting the database. You can also go to File > Import > (product) database.

See Also

Combining models with Submodel import

  • Created by Bentley Colleague
  • When:
  • Revisions: 1
  • Comments: 0
Recommended
Related