opensourceBIM / BIMserver

The open source BIMserver platform
GNU Affero General Public License v3.0
1.55k stars 610 forks source link

There is an issue with the downloaded IFC file #1317

Open jingyangking opened 6 months ago

jingyangking commented 6 months ago

I would like to ask why the IFC component downloaded from bimserver cannot be opened. Regardless of which version it is, it seems that Revit, ifcplusplus, and Blender cannot be opened after trying, or they are left blank when opened. What is the reason for this? Just like in the picture below, it cannot be opened image

hlg commented 4 months ago

Please post the query as source code, not hidden in a screenshot. As far as I can see, your query does not contain any geometry, just the list of building elements. You can have a look into the IFC file to confirm. There are ready-made includes, so that you don't have to write the whole query for the geometry yourself. Try the query below and replace ifc4-stdlibwith ifc2x3tc1-stdlib for IFC2X3 projects.

{
  "type": {
    "name": "IfcStair",
    "includeAllSubTypes": true
  },
  "includes": [
    "ifc4-stdlib:Representation",
    "ifc4-stdlib:ObjectPlacement"
  ]
}
ayacoub1 commented 2 months ago

I'm currently new to BIMserver and I'm working on creating a Python tool to upload and download IFC files into BIMserver. I've noticed that the downloaded file is empty and the size doesn't match the uploaded one. This issue occurs in both scenarios, using the code and the bimviews interface.

here is the query i am using

{
  "type": {
    "name": "IfcProduct",
    "includeAllSubTypes": true
  }
}

Here are a few questions I have:

zaqifathis commented 3 weeks ago

Hi @ayacoub1 ,

The query example you provided will not result in a valid IFC file. To be valid, it should always include at least one IfcOwnerHistory and one IfcProject object. For example:

{
"type": {
"name": "IfcProduct",
"includeAllSubTypes": true
},
"includes": [
    "ifc4-stdlib:ContainedInStructure",
    "ifc4-stdlib:OwnerHistory",
    "ifc4-stdlib:Representation",
    "ifc4-stdlib:ObjectPlacement"
  ]
}

You can also check the documentation regarding the query format here

hlg commented 3 weeks ago

I am adding some points to Zaqi's previous answer.

Strictly speaking, an IfcProject is not necessary for a valid IFC file, but if there are geometric representations in the file, then they need mandatory representation context where, for example, units are defined. The most common way of providing such context is through an IfcProject, but the include ifc4-stdlib:Representation will take care for the representation and including the context (without a project).

Some software will thus assume a project to be defined and start their interpretation of the file from that entry point, hence show nothing if there is no project. The project is also the root of the hierarchical spatial structure, storeys etc. It is included via the ifc4-stdlib:ContainedInStructure include above.

Owner history is a mandatory attribute for products in IFC2x3, but optional in IFC4. I believe that most software would still process the data when it is missing, even in IFC2x3. The include ifc4-stdlib:OwnerHistory takes care for that. If mandatory, this is for every entity of type IfcRoot - one "owner history" will not be enough.

As said before, if you use IFC2x3 replace ifc4 with ifc2x3tc1, the names of the includes are largely the same. You can also check the sample queries in BIMvie.ws. You may have noticed that writing queries requries in-depth knowledge of the IFC schema. You find the respective documentation at technical.buildingsmart.org.

Your other, general questions are not related to the original issue on the queries. For the API, please consult the wiki. For example, the AdminInterface provides methods to retrieve information about the projects and revisions, but also create new ones and download/upload data.

As for forums and other places for more general discussions and exchange, we currently do not have a dedicated place, but acknowledge the need for it, because this issue tracker is actually for bugs and implementation issues with the BIMserver core, not for questions on its usage, IFC details or general BIM, which come up all too often. We are discussing where to route such questions and requests in the future. There are already some places that are currently used: For specific questions on how to implement clients or plugins for BIMserver and details about its API, you can use Stackoverflow. If there are more BIMserver questions on Stackoverflow, we could renew the tag request. Other software like Xbim also has Stackoverflow tags. There are also (but very few) BIMserver discussions in the OSArch community and there is even a BIMserver tag.