Adding the ability to the BCF Libraries to connect with the API

edited March 2021 in General

Hey everyone, I am Prabhat a second-year undergraduate student from India, and I am interested to contribute to the OpenShell organization for this year's GSOC, I have experience with Python and Django. Looking forward to work with you all.
While going through the topics for this year's GSOC for IfcOpenShell I came across this topic ( and I have been reading and trying to understand the requirements and the things I have to do.



  • edited March 2021

    @Moult is guiding me on the tasks I need to do for getting started.
    I read the documentation of version 2.1 and 3.0 and trying to understand the difference between them, also I was going through this ( and as it's written that it is compatible with only 2.1 for now, so I tried to make few changes in the and file in order to make it compatible with the version 3.0, and also currently I am trying to understand how to create the Test Cases for existing bcf library. Thanks :)

  • Sounds exciting. I would love to hear about cooperation with commercial BCF servers out there like those listed here:

  • edited March 2021

    Things we have decided:

    1. The BCF module will have a submodule for each version. All the current data and XML functions and XSD will be moved into a version 2.1 module. We will not mix data structures for each version, nor write automatic translators between versions - each version will be separate.
    2. The new version 3.0 will have its own submodule. The majority of its functions will likely inherit from version 2.1. We will override the inheritance where 3.0 differs from 2.1.
    3. There will be a new parent level BCF XML module which will load existing projects and create new projects. Upon loading a project, it will first detect the BCF version used, then return a BCFXML class from the appropriate version submodule. Upon creating a project, the user will specify the BCF version to be used, and it will return a BCFXML class from that version's submodule too.
    4. The documentation cannot be trusted. I recommend doing a diff between the xsds of 2.1 and 3.0. Then for each xsd, a todo list will be written for every difference, no matter how small. For each todo item, we will need to decide how the code will be overridden.
    5. The user API functions should match the workflows described by the BCF API, even though currently we are still writing code to do with the BCF XML. This is because the API is the only documentation which specifies strictly how interaction can take place, so we should follow it.
    6. Submit a PR for the new requirements.txt file.
  • may be off topic ... How about bcf version 3.0? I could not find anything about it. What will be new there? Any interesting game changer?

  • @Moult
    very good and clean way to go!

  • @bernd by the end of GSoC the goal is to support BCFXML v2.1, BCFXML v3.0, and BCFAPI v3.0. You can find 3.0 docs by switching to the release3_0 branch in the BCF repos.

  • TODO List
    Differences between Version 3.0 and Version 2.1
    1. L-7 Detailed Version Element in Version 2.1 is not in Version 3.0
    2. Attribute VersionID in 3.0 is now required, in 2.1 there was nothing like this. (L-5 for 3.0 and L-9 for 2.1)
    1. L-4 Element Name changed from ProjectExtension to ProjectInfo .
    2. L-8 Element ExtensionSchema in 2.1 is not there in version 3.0
    3. L-14 and L-16 Type for Name and ProjectID is changed from xs:string to NonEmptyOrBlankString in version 3.0 (L-13 and L-15)

  • Markup.xsd
    1. L-9 and L-11 for Version 2.1, Comments and Viewpoints elements are not inside Markup element anymore for Version 3.0.
    2. L-15 for Version 2.1 and L-12 for Version 3.0, Structure of Header Element is changed, new Element "Files" is introduced in Version 3.0
    3. L-34 and L-36 for Version 2.1 and L-27 and 29 for Version 3.0, the type for Viewpoint and Snapshot is changed.
    4. L-52,53,55 for Version 2.1 and L-45,46,48 in Version 3.0, the type for Reference Schema, Reference, and Snippet Type is changed
    5. L-56 for Version 2.1 and L-49 for Version 3.0, "isExternal" is changed to "IsExternal" .
    6. L-61 for Version 2.1 and L-54 for Version 3.0, "Reference Links" is the new Element introduced, and the element "Reference Link" is moved inside it.
    7. L-66 for both versions, "Labels" is the new element introduced in Version 3.0, and the element "Label" is shifted inside it.
    8. L-67 and L-68 for version 2.1, and L-73 and 74 from version 3.0, the minOccurs changed.
    9. L-68 for Version 2.1 and L- 74 for Version 3.0 , type of CreationAuthor is changed.
    10. L-70 for Version 2.1 and L-76 for Version 3.0, type of "Modified Author" is changed.
    11. L-72,73,74 for Version 2.1 and L-78,79,80 for Version 3.0, types are changed for all 3 elements in these lines.
    12. L-77 for Version 2.1 and L-82 for Version 3.0, "Document References" is the new element introduced in Version 3,and Document Reference is moved into it.
    13. L-88 for Version 2.1 and L-89 for Version 3.0, "Related Topics" is the new element introduced and "Related Topic" is moved into it.
    14. L-100 for Version 3, "Comments" is the new element introduced and "Comment" element is created inside it.
    15. L-108 for Version 3, "Viewpoints" is the new element introduced and "ViewPoint" is created inside it .
    16. L-117 for Version 3, "ServerAssignedId" is the new Attribute in version 3.0
    17. L-121 for Version 3, "File" element of the header is here.
    18. L-136 to 151 for Version 3, Structure of Element "DocumentReference" is present here with new elements like DocumentGuid and Url
    19.L-108 for Version 2.1, and L-156 for Version 3, type for Author is changed .
    20. L-109 for Version 2.1 and L-157 for Version 3, type and minOccurs of Comment is changed and defined.
    21. L-116 for Version 2.1 and L-164 for Version 3, type for Modified Author is changed.
    22. L-120 to L-142 in Version 2.1 is removed from Version 3.0
    23. L-146 for Version 2.1,L-171 for Version 3, the pattern is changed.

  • I can't quite see what the conditions are for this project, but it could be worth reaching out to them. An implementation shown to work with them would be a good thing to promote.

  • Visinfo.xsd
    1. L-11,12 for Version 2.1, and L-15,16 for Version 3.0, minOccurs for Orthogonal Camera and Perspective Camera is removed.
    2. L-16 for Version 2.1, L-21 for Version 3.0, minOccurs for Line is introduced in Version 3.0
    3. L-28 for Version 2.1, L-32 for Version 3.0, "Bitmaps" is the new element introduced in Version 3.0, and Bitmap is moved inside it.
    4. L-54 for Version 3.0, New Element "Aspect Ratio" is introduced in Version 3
    5. L-71 for Version 3.0, Content of FieldofView is edited
    6. L-78 for Version 3.0, Aspect Ratio is introduced
    7. L-101 for Version 3.0, "PositiveDouble" is the new SimpleType introduced
    8. L-94,95 for Version 2.1, L-108,109 for Version 3.0 , "minInclusive" is changed to "minExclusive" value.
    9. L-100 for Version 2.1, "ViewSetupHints" is removed in Version 3.0.
    10. L-107 to L-111 in Version 2.1, is removed in Version 3.0.
    11. L-114,124 in Version 2.1, L-122,133 in Version 3.0, "minOccurs" for Component is added in Version 3.0.
    11. L-127 in Version 3.0 , "ViewSetupHints" is added in ComponentVisibility.
    12. L-129 in Version 2.1, L-138 in Version 3.0, default value is added in Version 3.0 for "DefaultVisibility" .
    13. L-139 to 143 in Version 3.0, "ViewSetupHints" is added here in Version 3.0 .
    14. L-147 in Version 3.0, "minOccurs" is added for the Color element.
    15. L-151 in Version 3.0, "Components" is added in Version 3.0 .
    16. L-138 in Version 2.1, L-159 in Version 3.0, "use" added in Version 3.0 .
    17. L-166,167 in Version 3.0 , type is changed for "OriginatingSystem" and "AuthoringToolId" in Version 3.0 .
    18. L-155 in Version 2.1, L-175 in Version 3.0, pattern is changed in Version 3.0.
    19. L-183 in Version 2.1, L-163 in Version 3.0, pattern is changed in Version 3.0.
    20. L-199 to 213 in Version 3.0, "Bitmap" is added here.
    21. L-182 ,183 in Version 2.1 , L-216,217 in Version 3.0, enum is changed .
    22. L-185 to 188 in Version 2.1 , is not anymore in Version 3.0.

  • @Prabhat would it be possible for you to submit a pull request for splitting the v2.1 and v3 into submodules and a common loader for each? For now, v3 can be an empty module until we go through the TODO list and implement it one by one.

  • edited May 2021

    Updates -:
    The folder structure for v2 and v3 has been pushed and merged, along with that a module loader file so that the script can automatically detect the version of the project loaded and then accordingly load the respective version library.
    Currently, we are working on the v3 bcfxml file, the work for the project and the version xsd is already done and the PR created.

  • Updates-:
    @Moult has reviewed the code for Markup.xsd and it's added to the Repository.
    Review for visinfo.xsd is remaining, mostly it will be finished by tomorrow.

  • Note to self - field of view needs to be reviewed in the implementation due to:

    1. L-71 for Version 3.0, Content of FieldofView is edited
  • edited July 2021

    The Implementation of BCF API for Version 3.0 is completed and is merged into the IfcOpenShell Repository.
    You can find it here -:

  • Awesome work @Prabhat ! I look forward to seeing it in use.

  • Just wanted to say how incredibly pleased I am with the work @Prabhat is doing :) He has shown great initiative and engagement in the OSArch chat!

  • Thanks A Lot @Moult , It was all because of the community support and because of your support couldn't ask for more :) .

Sign In or Register to comment.