IFC export workaround and question

This forum section is only for IFC-related issues
User avatar
thomas-neemann
Veteran
Posts: 11921
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: Wed Feb 22, 2023 9:22 pm ...
I deleted the output window before the export, so the messages should be complete.

how do I know which part it stops at?
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 »

you need to activate debug messages ... This is how it looks for me. In report console It is printed on which object the exporter stops ...


screen1.png
screen1.png (159.72 KiB) Viewed 2944 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 »

you might missed the debug messages because they seam to be activated on import even for export ...


screen1.png
screen1.png (21.89 KiB) Viewed 2942 times
User avatar
thomas-neemann
Veteran
Posts: 11921
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 7:29 am ...
I didn't have this "import" setting. now it looks like this





11:49:59 Exporting an IFC4 file...
11:49:59 1 : IfcWall ( brep ) : Wall__GF_3.1mH
11:49:59 2 : IfcWindow ( brep ) : Cl__Dr__1100x2100_13
11:49:59 3 : IfcWall ( brep ) : Wall__1F_Facade_3.8mH
11:49:59 4 : IfcWindow ( brep ) : Win__1F_Win_Front
11:49:59 5 : IfcWindow ( brep ) : Win__1F_Win_Right01
11:49:59 6 : IfcWindow ( brep ) : Win__1F_Win_Left01
11:49:59 7 : IfcWindow ( brep ) : Win__1F_Win_Left04_NoOpening_IfcPlusPlus
11:49:59 8 : IfcWindow ( brep ) : Win__1F_Win_Left02
11:49:59 9 : IfcWindow ( brep ) : Win__1F_Win_Left03
11:49:59 10 : IfcWindow ( brep ) : Win__1F_Win_Back
11:49:59 11 : IfcSlab ( brep ) : Struc__1F_Slab
11:49:59 12 : IfcWall ( brep ) : Wall__2F_2.8mH
11:49:59 13 : IfcWindow ( brep ) : Cl__Dr__1100x2100_01
11:49:59 14 : IfcWall ( brep ) : Wall__1F_3.1mH
11:49:59 15 : IfcDoor ( brep ) : Cl__Dr__1100x2100_02
11:49:59 16 : IfcDoor ( brep ) : Cl__Dr__1100x2100_03
11:49:59 17 : IfcDoor ( brep ) : Cl__Dr__1100x2100_04
11:49:59 18 : IfcWindow ( brep ) : Cl__Dr__1100x2100_05
11:49:59 19 : IfcWindow ( brep ) : Cl__Dr__1100x2100_06
11:49:59 20 : IfcDoor ( brep ) : Cl__Dr__1100x2100_07
11:49:59 21 : IfcDoor ( brep ) : Cl__Dr__1100x2100_08
11:49:59 22 : IfcWindow ( brep ) : Cl__Dr__1100x2100_09
11:49:59 23 : IfcWindow ( brep ) : Cl__Dr__1100x2100_10
11:49:59 24 : IfcWindow ( brep ) : Cl__Dr__1100x2100_11
11:49:59 25 : IfcDoor ( brep ) : Cl__Dr__1100x2100_12
11:49:59 26 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_01
11:49:59 27 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_02
11:49:59 28 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_02_Glass
11:49:59 29 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_03
11:49:59 30 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_03_Glass
11:49:59 31 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_04
11:49:59 32 : IfcWindow ( brep ) : Win__1F_Ramp_Opening_Window_04_Glass
11:49:59 33 : IfcWindow ( brep ) : Win__1F_Win_Court_02
11:49:59 34 : IfcBuildingStorey ( no shape ) : BldgPart__GF
11:49:59 35 : IfcBuildingStorey ( no shape ) : BldgPart__GF_WinDoor
11:49:59 Traceback (most recent call last):
File "<string>", line 96, in <module>
File "/tmp/.mount_31917-DA7Spy/usr/Mod/Arch/exportIFC.py", line 546, in export
product = createProduct(
File "/tmp/.mount_31917-DA7Spy/usr/Mod/Arch/exportIFC.py", line 2399, in createProduct
product = getattr(ifcfile,"create"+ifctype)(**kwargs)
File "/tmp/.mount_31917-DA7Spy/usr/lib/python3.10/site-packages/ifcopenshell/file.py", line 276, in create_entity
e[idx] = arg
File "/tmp/.mount_31917-DA7Spy/usr/lib/python3.10/site-packages/ifcopenshell/entity_instance.py", line 190, in __setitem__
method = self.method_list[idx]
<class 'IndexError'>: list index out of range
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 »

selekiere doch mal nur das objekt "BldgPart__GF_WinDoor" und versuche einen Export. Das ist ein Architekturobjekt BuildinPart (ist ein container) Fals der Fehler kommt, kannst Du ein FreeCAD datei erstellen mit nur dem Objekt speichern öffnen und wieder exportieren, wenn Fehler die FreeCAD datei hier posten.

gruss 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 »

Ha ich habe etwas gesehen ... Stelle mal in Arch auf Ifc2x3 um ... dann geht es. Wenn ich auf IFC4 umstelle kann ich reproduzieren ... Starte FreeCAD neu damit diese Einstellung sicher übernommen wird. Diese braucht ein Modulreload


screen1.png
screen1.png (56.92 KiB) Viewed 2847 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 »

sorry ... German ...

Switch to Ifc2x3 in Arch settings and restart FreeCAD because this setting needs a module reload. If I switch to IFC4 I can reproduce the problem.
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 »

here we are ... a small FreeCAD file of only one object ... this is needed to debug the problem ...

Code: Select all

14:22:11  Exporting an IFC4 file...
14:22:11  1    :  IfcSite  ( no shape ) :  Site
14:22:11  2    :  IfcBuilding  ( no shape ) :  Building
14:22:11  3    :  IfcBuildingStorey  ( no shape ) :  BldgPart__GF
14:22:11  4    :  IfcBuildingStorey  ( no shape ) :  BldgPart__GF_WinDoor
14:22:11  Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\Mod\Arch\exportIFC.py", line 549, in export
    product = createProduct(
  File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\Mod\Arch\exportIFC.py", line 2407, in createProduct
    product = getattr(ifcfile,"create"+ifctype)(**kwargs)
  File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\file.py", line 285, in create_entity
    e[idx] = arg
  File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\entity_instance.py", line 254, in __setitem__
    method = self.method_list[idx]
<class 'IndexError'>: list index out of range

Villa Savoye_one_obj_ifc4_export_problem.FCStd
(88.14 KiB) Downloaded 83 times


screen1.png
screen1.png (180.28 KiB) Viewed 2816 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 »

I was able to rebuild it from scratch ... a building part with a box and the type of the building part set to undefined results in export break because the method createProduct breaks in ifcopenshell.


ifc4_exportproblem_buildingpart_undefinedtype.FCStd
(23.68 KiB) Downloaded 86 times


screen1.png
screen1.png (154.25 KiB) Viewed 2789 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 »

same happens on a floor or building object if the type is set to "undefined" (actually they will switch to a building part object because of this setting) but it does not happen if the type of a structure or a wall is set to undefined.
Post Reply