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

Missing properties while converting IFC to JSON #57

Open
castronelson opened this issue Jan 2, 2021 · 3 comments
Open

Missing properties while converting IFC to JSON #57

castronelson opened this issue Jan 2, 2021 · 3 comments

Comments

@castronelson
Copy link

Hi,
Hope you are doing well!!!
We have converted IFC file to JSON and WEXBIM format while uploading the IFC file in our web application.
After JSON conversion - some 'IFCCOVERING' type of properties are missing in JSON file. I have herewith attached the screenshot for your reference.
Kindly provide a sample c# code to convert IFC to JSON file (with exporting all properties without missing anything).

IFCCOVERING

Thank you in advance.

@martin1cerny martin1cerny transferred this issue from xBimTeam/XbimWebUI Jan 4, 2021
@martin1cerny
Copy link
Member

I assume you are using XbimExchange to convert IFC to JSON file. Conversion is configurable and you can see the complete conversion in the source. So, I'd recomend to have a look at it. If you want to use this as part of any web application, you might want to think about something else than one big JSON file as it is not scalable.

At xbim ltd. we have a commercial cloud service where you could offload geometry processing (from IFC to wexbim) and get a scalable access to IFC data (JSON REST services). Let me know if you were interested.

@castronelson
Copy link
Author

castronelson commented Jan 7, 2021

Hi, we are not able to get complete Json file, Some IFC properties are missing. Below is the code we are using in our application to convert JSON.

using (var m = IfcStore.Open(IfcTestFile))
            {
                var xbimTestFile = Path.ChangeExtension(IfcTestFile, "xbim");
                var jsonFile = Path.ChangeExtension(IfcTestFile, "json");
                var helper = new COBieLite.CoBieLiteHelper(m, "UniClass");
                var facilities = helper.GetFacilities();
                var NewJsonFile = jsonFile;
                foreach (var facilityType in facilities)
                {
                    Assert.IsTrue(facilityType.FacilityDefaultLinearUnitSpecified);
                    Assert.IsTrue(facilityType.FacilityDefaultAreaUnitSpecified);
                    Assert.IsTrue(facilityType.FacilityDefaultVolumeUnitSpecified);                    
                    using (var fs = new StreamWriter(NewJsonFile))
                    {
                        Xbim.COBieLite.CoBieLiteHelper.WriteJson(fs, facilityType);
                        fs.Close();
                    }
                }
            }

we are not able to export the properties (IFCCOVERING, IFCROOF,IFCSTAIR,IFCMEMBER,IFCSITE,IFCDOOR,IFCPLATE)
when we searching in IFC file many records are available. But after the JSON conversion above properties are missed.

Please help me on this. Kindly provide any c# code to convert IFC to JSON file (with exporting all properties without missing anything).

Thanks in advance

@martin1cerny
Copy link
Member

COBie specification states that some element types should not be exported. Feel free to change the settings or the code.

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

2 participants