Exception creating Model Context
Attached model gives an exception when creating the model context. This model does load into a earlier version of xBim Viewer using version 4 assemblies and it's loading into other IFC viewers like Solibri etc.
I have tracked this issue down eight elements with solids defined with IIfcArbitraryClosedProfileDef. This is the Guid of one that's causing the issues... 0$ktGmpNf3K8n9aoHEAwIr
I have also pulled the latest source code and rebuilt the geometry dll locally and the issue isn't occurring so perhaps it's been corrected.
Can you confirm if this still an issue? Thanks very much.
Kind regards Bill Malcolm
Used assemblies Xbim.Common.dll 5.01.289.0 Xbim.Geometry.Engine.Interop.dll 5.01.317.0 Xbim.Geometry.Engine64.dll 5.01.317.0 Xbim.Ifc.dll 5.01.289.0 Xbim.Ifc2x3.dll 5.01.289.0 Xbim.Ifc4.dll 5.01.289.0 Xbim.IO.MemoryModel.dll 5.01.289.0 Xbim.ModelGeometry.Scene.dll 5.01.317.0 Xbim.Tessellator.dll 5.01.289.0
Stack Trace
Xbim.Common.Exceptions.XbimException: Processing halted due to model error ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at Xbim.Common.Collections.ItemSet1.get_Item(Int32 index) at Xbim.Ifc2x3.GeometryResource.IfcCurve.get_Dim() at Xbim.Ifc2x3.GeometryResource.IfcCurve.Xbim.Ifc4.GeometricModelResource.IfcGeometricSetSelect.get_Dim() at Xbim.Geometry.XbimWire.Init(IIfcArbitraryClosedProfileDef profile, ILogger logger, XbimConstraints constraints) at Xbim.Geometry.XbimWire.Init(IIfcProfileDef profile, ILogger logger, XbimConstraints constraints) at Xbim.Geometry.XbimWire..ctor(IIfcProfileDef profile, ILogger logger, XbimConstraints constraints) at Xbim.Geometry.XbimFace.Init(IIfcProfileDef profile, ILogger logger) at Xbim.Geometry.XbimFace..ctor(IIfcProfileDef profile, ILogger logger) at Xbim.Geometry.XbimSolid.Init(IIfcExtrudedAreaSolid solid, IIfcProfileDef overrideProfileDef, ILogger logger) at Xbim.Geometry.XbimSolid..ctor(IIfcExtrudedAreaSolid solid, ILogger logger) at Xbim.Geometry.XbimGeometryCreator.CreateSolid(IIfcExtrudedAreaSolid ifcSolid, ILogger logger) at Xbim.Geometry.XbimGeometryCreator.Create(IIfcGeometricRepresentationItem geomRep, IIfcAxis2Placement3D objectLocation, ILogger logger) at Xbim.Geometry.Engine.Interop.XbimGeometryEngine.Create(IIfcGeometricRepresentationItem ifcRepresentation, ILogger logger) at Xbim.ModelGeometry.Scene.Xbim3DModelContext.<>c__DisplayClass39_0.<WriteShapeGeometries>b__0(Int32 shapeId) at System.Threading.Tasks.Parallel.<>c__DisplayClass42_02.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object 1 source, ParallelOptions parallelOptions, Action1 simpleBody, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body)
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.WriteShapeGeometries(XbimCreateContextHelper contextHelper, ReportProgressDelegate progDelegate, IGeometryStoreInitialiser geometryStore, XbimGeometryType geomStorageType)
--- End of inner exception stack trace ---
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.WriteShapeGeometries(XbimCreateContextHelper contextHelper, ReportProgressDelegate progDelegate, IGeometryStoreInitialiser geometryStore, XbimGeometryType geomStorageType)
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.CreateContext(ReportProgressDelegate progDelegate, Boolean adjustWcs)
at hsbCAD.IFCUtils.IFCtoMap.LoadIFC(String ifcFilePath)
Still an issue in 5.1.346. It processes gracefully but with an error logged:
Processing failure
General Error Creating IfcExtrudedAreaSolid, #9774
at Xbim.Geometry.XbimGeometryCreator.Create(IIfcGeometricRepresentationItem geomRep, IIfcAxis2Placement3D objectLocation, ILogger logger)
at Xbim.Geometry.Engine.Interop.XbimGeometryEngine.Create(IIfcGeometricRepresentationItem ifcRepresentation, ILogger logger)
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.<>c__DisplayClass39_0.<WriteShapeGeometries>b__0(Int32 shapeId)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)