XbimGeometry icon indicating copy to clipboard operation
XbimGeometry copied to clipboard

v6: Can't use Xbim3DModelContext without registering services with services.AddXbimGeometryEngine()

Open andyward opened this issue 2 years ago • 0 comments

Under v6 GE, invoking

var context = new Xbim3DModelContext(model);

Throws InvalidOperationException: An implementation of IXbimGeometryServicesFactory could not be foundEnsure you have registered the GeometryEngine with services.AddXbimGeometryEngine()

The workaround is to add the following at application startup

Xbim.Common.Configuration.XbimServices.Current.ConfigureServices(s => s.AddXbimGeometryServices());

We should look to streamline this so ModelScene does this for developers. The common challenge is that the Services Container may have been constructed before any initialisation code can be invoked. Alternatively, make the error much more explicit about the corrective action.

andyward avatar Aug 22 '23 10:08 andyward