-
Notifications
You must be signed in to change notification settings - Fork 30
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
can't export gltf andjson file #24
Comments
Hello, What files are you expecting to find, please bear in mind that we maintain several packages. it would help us if you make your expectations clear when reporting an issue. Thanks, |
hello@CBenghi , |
Sorry the question is still not clear. |
Hello,I download the project XbimGLtf,and use nuget to reference the library in my project via Visual Studio,then i try to rebuild the MainTests.I haven't take other action ,only use the example OneWallTwoWindows.ifc . |
If you want to pass your own files, you will have to reference the library in your code and use code similar to the one in the tests, but pointing to your own IFC file. Can you share the code you are using to point to your file on the disk? |
Sorry,I just try to use the example ConversionTests.cs .Can't this test convert OneWallTwoWindows.ifc file to .GLtf and .json file? public void CanConvertOneFile() { var ifc = new FileInfo("OneWallTwoWindows.ifc"); var xbim = CreateGeometry(ifc, true, false);
using (var s = IfcStore.Open(xbim.FullName)) { Stopwatch sw = new Stopwatch(); sw.Start();
var savename = Path.ChangeExtension(s.FileName, ".gltf"); var bldr = new Builder(); var ret = bldr.BuildInstancedScene(s, XbimMatrix3D.Identity); glTFLoader.Interface.SaveModel(ret, savename);
Debug.WriteLine($"Gltf Model exported to '{savename}' in {sw.ElapsedMilliseconds} ms."); FileInfo f = new FileInfo(s.FileName);
// write json // var jsonFileName = Path.ChangeExtension(s.FileName, "json"); var bme = new Xbim.GLTF.SemanticExport.BuildingModelExtractor(); var rep = bme.GetModel(s); rep.Export(jsonFileName); } }
private static FileInfo CreateGeometry(FileInfo f, bool mode, bool useAlternativeExtruder) { IfcStore.ModelProviderFactory.UseHeuristicModelProvider(); using (var m = IfcStore.Open(f.FullName)) { var c = new Xbim3DModelContext(m); c.CreateContext(null, mode); var newName = Path.ChangeExtension(f.FullName, mode + ".xbim"); m.SaveAs(newName); return new FileInfo(newName); } }
Is this unable to achieve the goal? |
Hi,i just download the code and run Maintests,but the two files don't exsit in bin/debug/net472/Files ,what happened?Hope your reply!
The text was updated successfully, but these errors were encountered: