IFC export workaround and question

This forum section is only for IFC-related issues
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

it is more difficault than I expected to find where is the best place to fix the problem ...

For BuildingParts with IfcType set to "Undefined" the ifctype for IFC export is set to IfcBuildingStorey https://github.com/FreeCAD/FreeCAD/blob ... 1696-L1697

but when creating the product the Attributes are still created with the FreeCAD object with IfcType Undefined this results in different kwargs for a real building storey and for the tweaked building storey.

Code: Select all

 real IfcBuildingStorey
16:03:40  {'GlobalId': '3zYEt1WErDlxVgLzyyHODP', 'OwnerHistory': #5=IfcOwnerHistory(#3,#4,$,.ADDED.,1677164620,#3,#4,1677164620), 'Name': 'BuildingPart', 'Description': '', 'ObjectPlacement': None, 'Representation': None, 'CompositionType': 'COMPLEX', 'LongName': 'BuildingPart'}

BuildingPart set to Undefined and ifctype set to IfcBuildingStorey on export
16:02:54  {'GlobalId': '3zYEt1WErDlxVgLzyyHODP', 'OwnerHistory': #5=IfcOwnerHistory(#3,#4,$,.ADDED.,1677164574,#3,#4,1677164574), 'Name': 'BuildingPart', 'Description': '', 'ObjectPlacement': None, 'Representation': None, 'PredefinedType': 'COMPLEX'}
A building storey does not have a PredefinedType but a CompositionType thus IfcOpenShell does break creating the Product ... https://iaiweb.lbl.gov/Resources/IFC_Re ... storey.htm

the different kwargs happen because the ifctype was changed but in method exportIfcAttributes() https://github.com/FreeCAD/FreeCAD/blob ... C.py#L1753 does not use the changed type but the original type instead which creates wrong attributes for the changed type.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

generally it is a bad idea to introduce the ifctype and set it different to the FreeCAD object but later on creating the parameter kwargs for ifcopenshell use again the original IfcType from the FreeCAD object but pass the ifctype which was changed to ifcopenshell. This could be fixed in various ways. I will just make a small fix and let this decide this to others.

BTW: IMHO we should totally get rid of undefined. Ifc has something for undefined IfcBuildingElementProxy or IfcBuildingElementPart.

cheers bernd
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

User avatar
thomas-neemann
Veteran
Posts: 11919
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: IFC export workaround and question

Post by thomas-neemann »

bernd wrote: Thu Feb 23, 2023 12:51 pm ...

Switch to Ifc2x3 ....

so it runs for me without stopping, but it is incomplete
Bildschirmfoto_2023-02-23_17-14-44.png
Bildschirmfoto_2023-02-23_17-14-44.png (16.51 KiB) Viewed 2918 times
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

Have you used BREP pref? if you are interested in improving the export, you should make a simple FreeCAD file with a missing object open a new topic, post your export preferences. This topic was mainly because the export was broken.
User avatar
thomas-neemann
Veteran
Posts: 11919
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: IFC export workaround and question

Post by thomas-neemann »

bernd wrote: Thu Feb 23, 2023 5:49 pm ...

here are my settings
Bildschirmfoto_2023-02-24_08-22-02.png
Bildschirmfoto_2023-02-24_08-22-02.png (88.47 KiB) Viewed 2804 times
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC export workaround and question

Post by yorik »

Interesting, I didn't know about BuildingElementPart... That seems totally right to use it in this context, much better than undefined.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

yorik wrote: Fri Feb 24, 2023 2:00 pm Interesting, I didn't know about BuildingElementPart... That seems totally right to use it in this context, much better than undefined.
lately ArchiCAD and VectorWorks do use it to export multilayered objects into ifc, each layer gets its own product and its own representation ... much better than multilayered material and IfcComplexAttributes and only one Representation for all layer as it has been for years ...

screen1.png
screen1.png (209.46 KiB) Viewed 2738 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

BTW: native importer somehow does not support them ... Will make an issue at github ...


screen1.png
screen1.png (137.47 KiB) Viewed 2718 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export workaround and question

Post by bernd »

damn, just realised in ArchiCAD the layer is IfcBuldingPart and the container is IfcWall ... Mhh than the IfcBuildingPart would be wrong for the container. I will have a closer look at this and come back.

cheer bernd
Post Reply