Which APP or software can revert IFC to JSON.

Just a little question. I mean, JSON is so good in the Web developing. So I try to ask you which APP or software can revert IFC to JSON.

«1

Comments

  • When you use "IFC" it means that you talk about IFC Schema (or IFC Spec) which bSI says they provide a JSON format too, but I've never checked to find that is it available? And correct? or not?

    When you use "Ifc or .ifc" then it's about the file format and there're few solutions to convert .ifc to .json especially there're two things you have care about:

    1. Geometry/Topology
    2. Semantics

    So, converting semantics to .json directly is possible and useful, but Geometry/Topology you have to have a json-based geometries/typologies methodology/technnologgy, for instance, glTF/WebGL

    I don't know, but maybe xBIM could do what you (and I) want

    shanmama
  • @Jesusbill do you use JSON-based method in the viewer you develop?

    I saw you use Three.js and also Vue.js which are good choices

  • @shanmama - buildingSMART has had a few research initiatives to represent IFC data in JSON syntax. However, as of today, there is not yet an official IFC JSON syntax agreement - there are many ways to represent the IFC data and nobody has yet standardised it. That said, I am aware that it is on the buildingSMART roadmap. I will ask to see whether or not they will make their roadmap publicly available.

    That said, if you want to get a bit of data for a specific usecase which happens to be in JSON format, you can do this with IfcOpenShell, or the Blender Python console, or xBIM. It requires writing a bit of code, though.

    The IFC-to-Code_Aster project by @Jesusbill relies on converting IFC data from STEP syntax to JSON data, but it only converts a small subset related to structural analysis. This may or may not be suitable for your use. It uses IfcOpenShell.

    shanmama
  • @Moult I didn't know IfcOpenShell supports JSON, IfcConvert just listed XML

    Hope soon bSI does it.

    First of all they need to find what's the way the want to go? They have chosen UML as a language, however they have to choose which Data Modeling is suitable for IFC too

    shanmama
  • @ReD_CoDE @shanmama As Dion said we are using ifcopenshell to extract a JSON file. But I wouldn't say that this means that IFC supports JSON. Forr all I know, I could even save the same data in an excel file with pyopenxl, it does not mean that IFC supports XLS.

    JSON is like a txt file, one can use it to create his own data schema to use in his workflow and this would entail looking into the ifc files and extracting and writing the info you want in the schema you want. Of course this will break the chain of interoperability, if you want to go back to ifc from your JSON you will have to write the new ifc file yourself.

    shanmama
  • @Jesusbill Hope bSI develops IFC schema based on JSON too, however, it seems that it takes time, until 2021

    I think the best choice for IFC format to other schemas/formats is SQL and SQLite which inherently support JSON too

    Which caused IfcSharp (https://github.com/IfcSharp) movement

  • I saw today a post in LinkedIn about ISO 23386.

    "The ISO 23386 standard is now published. It is a big step forward the common description and management of properties and groups of properties into #dictionaries for #BIM."

    https://www.iso.org/standard/75401.html

    ReD_CoDE
  • @Jesusbill @ReD_CoDE @Moult

    Wow!I've been busy in the last few days, I didn't see a few discussions in time.

    You know, whether it is .ifc or .ifcxml documents, there is a lot of duplicate information. Recently I developed a software for compressing .json files. We all know that the conversion of .json and .xml is very easy (many websites can convert it online), so I actually developed an indirect .ifcxml file compression tool.

    So, I raised the issue of converting .ifc to .json last week. Because my compressed object is a .json file.

    In the next step, I plan to optimize for .xml (or specifically .ifcxml). At that time, I hope you can give me suggestions! Thank you again!

  • @shanmama As Dion @Moult told me a couple of days ago, IfcOpenShell can parse IFC to JSON

    However, it's better Dion talks about it and its pros and cons and limitations


    Ifc2Json, Ifc2SQL, ifc2SQLite, and Ifc2CSV are three things that I think are really important in OpenBIM environment today for many usecases

  • @shanmama - what do you mean by there is a lot of duplicate information in .ifc/ifcxml files?

    Also, IfcOpenShell now has a little bit of code which does IFC to and from CSV, if anybody is interested :) You can export a subset of IFC elements along with a list of properties, and then re-import that after changing the CSV file. See: https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.6.0/src/ifccsv

  • @Moult I don't see anything about JSON? It means that we have to convert IFC to CSV then to JSON?


  • Some paper said duplicate information. Maybe you can search "IFC Compressor" by Google. I found 2 papers to do it.

  • @ReD_CoDE - that link I provided was about IFC and CSV, not with JSON. They are separate utilities.

    @shanmama - it is possible (and sometimes likely) that a vendor can implement an IFC exporter that creates IFC data which contains duplicate non-rooted elements. This can lead to "duplicates" in the IFC file. If a vendor does this, it is their fault for not keeping their IFC data clean. Tools like Solibri's Optimiser simply removes these duplicate non-rooted elements. This does not mean that IFC contains "a lot of duplicate" information, it simply means that the vendor has done a poor job of writing their exporter.

    krande
  • OK I see. Now I developed an compression tool to compress those poor .ifcxml doc.

  • @Moult I found this view is very interesting: "If a vendor does this, it is their fault for not keeping their IFC data clean. " I want to

    cite this view in my newest paper, so which paper or book can I cite as reference?


    Thank you!

  • I'm not sure what paper or book can be cited. I am simply talking from experience.

    I just did a test: a 60mb Revit model with 919,707 lines of IFC code. Once STEP identifiers are removed, a unique sort will reveal duplicate non-rooted elements (rooted elements will always be maintained, so only completely duplicate non-rooted elements will be removed).

    The results are that from 919,707 lines of code we end up with 718,430 lines of IFC code. This is a reduction of 22% of the filesize. If Revit had developed their export tool with better element recycling, we would have smaller models.

    Note that this is the bare minimum by which we can have a smaller model. There are many other ways to decrease a model's size, but this is just the most basic way.

  • OK. I want to cite your point of view in my own research paper. Can I set your website as a reference? As you know, it is very important to express the views of others clearly in academic writing.

  • More than happy :)

  • Just to let you know, you can of course reference his site but you can also reference him directly, something like:

    Moult, D. 2020. Personal communication

  • Hi @shanmama hope these two help with:

    1. IFC2JSON 1.0 and 2.0 + IFCJSON Viewer (https://github.com/IFCJSON-Team)
    2. IFC2B3DM (https://github.com/Erfan-Shooraj/ifc2b3dm)
    Jesusbillshanmama
  • @ReD_CoDE said:
    Hi @shanmama hope these two help with:
    IFC2JSON 1.0 and 2.0 + IFCJSON Viewer (https://github.com/IFCJSON-Team)
    IFC2B3DM (https://github.com/Erfan-Shooraj/ifc2b3dm)

    Thx! I try to use IFC2JSON.

  • I was playing a bit now with https://github.com/IFCJSON-Team/IFC2JSON_python and it looks pretty good!

  • This sounds like something that is fairly trivial to implement in the BlenderBIM Add-on. Any takers?

  • *Do you mean export in Json from BlenderBIM?
    The fact that is GPL license causes any issue with ifcopenshell being LGPL?

    ReD_CoDE
  • Maybe IfcOpenShell is LGPL, but then maybe the BlenderBIM Add-on portion can be GPL, and therefore also consume it? Not sure. I'll open a bugreport.

    https://github.com/BIM-Tools/IFC2JSON_python/issues/1

    Jesusbill
  • Would be nice actually as a feature in BlenderBIM, I could actually work on it if no-one else is interested to do it and if theguys at IFC2JSON respond positively. Nice issue post by the way, I like your wit :)

  • Cheers :) Code should probably be called from here, elif extension == 'ifcjson': ...: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcblenderexport/blenderbim/bim/export_ifc.py#L2535

    Also need to add a file extension check here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcblenderexport/blenderbim/bim/operator.py#L58

    Should be straightforward :)

    Jesusbill
  • edited May 2020

    @Moult I am working on this implementation and I should be pretty close but I have a question.
    In def write_ifc_file in export_ifc.py for extension == 'ifcjson' how would I access the content of the ifc file that I would need to feed to the ifc2json function? I guess self.ifc_export_settings.output_file is just the filename?

  • @Jesusbill not sure where I can find this ifc2json function, but self.file holds the IfcOpenShell file ... and since IFC2JSON works with IfcOpenShell too, it should be pretty straightforward :)

  • @Moult let me explain it better, yes there is no ifc2json function in the original file.
    In any case, in the ifc2json code the ifc_file is:
    ifc_file = ifcopenshell.open(pathToIfcFile)
    In blenderbim export_ifc.py how I would obtain ifc_file?
    ifc_file = ifcopenshell.open(self.file.??)
    or what?

Sign In or Register to comment.