Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Reading File; CreateContext() crashes #120

Closed
martin-loucka opened this issue Jul 12, 2018 · 8 comments
Closed

Bug: Reading File; CreateContext() crashes #120

martin-loucka opened this issue Jul 12, 2018 · 8 comments
Milestone

Comments

@martin-loucka
Copy link

martin-loucka commented Jul 12, 2018

Hello

xBim is an excellent tool. But after a couple months, I run into a problem.
I can not open one Solibri Optimizer processed IFC file.

Do guys know how to deal with it?

Problem:
IfcStore model = IfcStore.Open(ifcFileName);
if (model.GeometryStore.IsEmpty)
{
var context = new Xbim3DModelContext(model);
context.CreateContext(); // Crashes here
}

StackTrace:
at BRepOffsetAPI_MakePipe.{ctor}(BRepOffsetAPI_MakePipe* , TopoDS_Wire* , TopoDS_Shape* )
at Xbim.Geometry.XbimGeometryCreator.CreateGrid(IIfcGrid grid)
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.WriteShapeGeometries(XbimCreateContextHelper contextHelper, ReportProgressDelegate progDelegate, IGeometryStoreInitialiser geometryStore, XbimGeometryType geomStorageType) in c:\BuildAgent\work\860c3b913b6c647f\Xbim.ModelGeometry.Scene\Xbim3DModelContext.cs:line 1136
at Xbim.ModelGeometry.Scene.Xbim3DModelContext.CreateContext(ReportProgressDelegate progDelegate, Boolean adjustWcs) in c:\BuildAgent\work\860c3b913b6c647f\Xbim.ModelGeometry.Scene\Xbim3DModelContext.cs:line 678
at UnitTests.GeoReader.ReadGeo(String ifcFileName) in C:...\01_Code\99_Tests_UnitTests\xbimm.cs:line 33

Versions of xBIM Packages:

  • Xbim.Common v4.0.30319
  • Xbim.Geometry v4.0.30319

Minimal file to reproduce the issue:

Files content is not public but could be sent per private message.

@CBenghi
Copy link
Member

CBenghi commented Jul 12, 2018

Hi Martin,
can you send file references (wetransfer?) to my gmail?
claudio.benghi@gmail.com
I'm doing some code work these days.
Claudio

@CBenghi
Copy link
Member

CBenghi commented Jul 13, 2018

I've opened the file with the latest version of xplorer and while there are a few warnings and two errors I do not get the crash, so I'm suspecting you are not working on the develop branch.
We should certainly produce an updated master soon, but we're not quite there yet.
Can you check if you can open the file in xplorer?

@martin-loucka
Copy link
Author

Yes. I was able to open it in xplorer...
Okay, I will give a try with the develop branch.

PS. I am facing another issue with IIfcElementQuantities. Could you please give me a quick hint how to read all the quantities from the IFC?

I can get custom Psets easily but not the Quantities :/
Thanks

@martin1cerny
Copy link
Member

Please, see the documentation for IfcPropertySetDefinition.

@martin-loucka
Copy link
Author

@martin1cerny My fault.. It works

@martin-loucka
Copy link
Author

martin-loucka commented Jul 15, 2018

I have tested the Develop Branch and it is not the problem. I have also checked the definition of the CreateContext() function in the source C# file but I still don't understand following.

When the Xplorer loads an IFC file and finds some errors it skips the problematic instances and continues loading the file. The errors are later just reported in the log file.

If I start the context.CreateContext() function from my code and it runs in some error the function just crashes. I don't see a way how to continue loading after an error is hit. Could you please give me one an additional explanation how to deal with it?


var context = new Xbim3DModelContext(model);
context.CreateContext(); // Crashes here

@martin-loucka martin-loucka reopened this Jul 15, 2018
@martin-loucka
Copy link
Author

Those two issues are related
https://github.com/xBimTeam/XbimWindowsUI/issues/88

@andyward
Copy link
Member

andyward commented Nov 9, 2018

Duplicate of #135 - Tracking that one instead

@andyward andyward closed this as completed Nov 9, 2018
@andyward andyward added this to the 5.1.0 milestone Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants