Problems with IFC

This forum section is only for IFC-related issues
langk
Posts: 10
Joined: Sat Nov 09, 2019 11:39 am

Problems with IFC

Post by langk »

Hey,

I have some issues with exporting and importing IFC files.

FreeCAD Version: 0.18.4, Win 10

I modeled a simple house with, I think, no complex structure.

I downloaded the latest version of IfcOpenShell (https://github.com/IfcOpenShell/IfcOpenShell, master branch) and followed the installation instructions of the FreeCAD wiki. An error message was not displayed.
PYConosle.PNG
PYConosle.PNG (1.72 KiB) Viewed 2579 times
But every time I try to export an IFC file, I get the following error:
error.PNG
error.PNG (28.71 KiB) Viewed 2579 times
I'm not an IFC expert but I assume that meas the wrong IFC version is used?
According to the Preflight Checks - Tool the IFC4 support is not enabled but all my Psets are IFC4 Add2, so maybe this causes the error?
But I have no clue where to change the used IFC version...According to the wiki entry of FreeCAD (https://www.freecadweb.org/wiki/Arch_IFC), the used IFC version (2x3 or 4) should be visible in the Arch preferences, but I can't find anything there regarding IFC.

The other problem is, I tried to import some really easy IFC files exported from Revit but every time FreeCAD crashes. I also tried to open this IFC file I found on another Forum post (https://forum.freecadweb.org/viewtopic.php?f=39&t=36754).

file: http://ifcopenshell.org/ifcopenhouse/v4 ... nHouse.ifc

But it's not working. But it is IFC 2x3 which is most likely set.
So did I do something wrong with the IfcOpenShell installation?

I would be very grateful if someone could help me out!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems with IFC

Post by bernd »

ifcopenshell 0.5 can either import 2x3 or 4 never both. Best is to use 0.6 which can import both. In FreeCAD 0.19 dev versions for windows it is included allready but you can use it with FreeCAD 0.18 too.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems with IFC

Post by bernd »

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

Re: Problems with IFC

Post by bernd »

btw.
if you are on windows the right version of ifcopenshell was installed already. You may broke it or installed a outdated version of ifcopenshell.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems with IFC

Post by bernd »

if you have 0.5 installed you can check the shema of ifcopenshell with

Code: Select all

import ifcopenshell
ifcopenshell.version
ifcopenshell.schema_identifier
FreeCAD 0.18.3 for Windows gives me:

Code: Select all

>>> 
>>> import ifcopenshell
>>> ifcopenshell.version
'0.5.0-dev'
>>> ifcopenshell.schema_identifier
'IFC2X3'
>>> 
langk
Posts: 10
Joined: Sat Nov 09, 2019 11:39 am

Re: Problems with IFC

Post by langk »

I also downloaded the branch v0.6 but it didn't worked neither..

So now I downloaded FreeCAD v0.19 and it's pretty amazing to see the development from v0.18 to 0.19. Thanks to everyone.

But unfortunately the export is still not working. Now this error appears:
errorexport.PNG
errorexport.PNG (12.32 KiB) Viewed 2514 times
User avatar
hlg
Posts: 39
Joined: Fri Jul 12, 2019 10:11 am

Re: Problems with IFC

Post by hlg »

From a quick look this may be a property value with a wrong type, e.g. you entered a String or Real for a property of type Integer. Can you try to export without property sets to confirm?
Last edited by hlg on Fri Nov 15, 2019 11:30 am, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems with IFC

Post by bernd »

in addition ... Would you share a simple FreeCAD file which only contains one object to reproduce the problem?
langk
Posts: 10
Joined: Sat Nov 09, 2019 11:39 am

Re: Problems with IFC

Post by langk »

hlg wrote: Fri Nov 15, 2019 11:24 am From a quick look this may be a property value with a wrong type, e.g. you entered a String or Real for a property of type Integer. Can you try to export without property sets to confirm?
Thanks for that hint.
I exported one object without Psets and after this again with and both worked. So in order to locate the problem I exported level for level and object for object. And that brought me to one of my structure objects. In order to reproduce my error I attached a reduced version of my project. I already tried to export this structure without Pset but its still the same error...
Attachments
Haus_Uebung2_reduced.FCStd
(879.83 KiB) Downloaded 57 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems with IFC

Post by bernd »

I can confirm the problem.

BTW if you add an Project object it works for me ...

Haus_Uebung2_reduced_BHA.FCStd
(29.64 KiB) Downloaded 78 times
Post Reply