IFC import fails in v0.19
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
IFC import fails in v0.19
When I import Yorik's House in version 0.19 FreeCAD crashes with this error
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18644 (Git)
Build type: Release
Branch: master
Hash: 481870be2b48ef95b59acf1440b069d42b6fad23
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Even importing other IFC files creates errors and fails. See https://forum.freecadweb.org/viewtopic.php?f=28&t=40576 ( Italian forum)
OS: Windows 8.1 (6.3)Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18644 (Git)
Build type: Release
Branch: master
Hash: 481870be2b48ef95b59acf1440b069d42b6fad23
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Even importing other IFC files creates errors and fails. See https://forum.freecadweb.org/viewtopic.php?f=28&t=40576 ( Italian forum)
Re: IFC import fails in v0.19
run the following code in FreeCAD
ifcopenshell does not find a IfcProject and thus FreeCAD hangs. We should fix the crash in a first step.
but if the file is opened in an editor there is a IfcProject
In a second step the question is, why does ifcopenshell does not find the IfcProject if there is one.
BTW: the file was exported with FreeCAD on 5th of march in 2016. Might be there is a problem with the file.
Code: Select all
import ifcopenshell
ifcfile = "C:/Users/BHA/Downloads/CasaYorik.ifc"
f = ifcopenshell.open(ifcfile)
f.by_type('IfcProject')
Code: Select all
>>>
>>> import ifcopenshell
>>> ifcfile = "C:/Users/BHA/Downloads/CasaYorik.ifc"
>>> f = ifcopenshell.open(ifcfile)
>>> f.by_type('IfcProject')
[]
>>>
Code: Select all
#20=IFCPROJECT('d90775e9_7071_491c_a93',#5,'house',$,$,$,$,(#11),#19);
BTW: the file was exported with FreeCAD on 5th of march in 2016. Might be there is a problem with the file.
Re: IFC import fails in v0.19
more informations. It seams IFC4 related ...
Attached two simple ifc exported from Allplan one is ifc2x3, one is ifc4. The ifc2x3 works great whereas for the ifc4 no IfcProject is found ...
Attached two simple ifc exported from Allplan one is ifc2x3, one is ifc4. The ifc2x3 works great whereas for the ifc4 no IfcProject is found ...
Code: Select all
import ifcopenshell
ifcopenshell.open("C:/Users/BHA/Desktop/box_ifc2x3.ifc").by_type('IfcProject')
ifcopenshell.open("C:/Users/BHA/Desktop/box_ifc4.ifc").by_type('IfcProject')
Code: Select all
>>>
>>> import ifcopenshell
>>> ifcopenshell.open("C:/Users/BHA/Desktop/box_ifc2x3.ifc").by_type('IfcProject')
[#35=IfcProject()]
>>> ifcopenshell.open("C:/Users/BHA/Desktop/box_ifc4.ifc").by_type('IfcProject')
[]
>>>
Re: IFC import fails in v0.19
issue on ifcopenshell is created: https://github.com/IfcOpenShell/IfcOpenShell/issues/711
Re: IFC import fails in v0.19
Code: Select all
import ifcopenshell
ifcopenshell.version
ifcopenshell.schema_identifier
Code: Select all
>>> ifcopenshell.version
'0.5.0-rc1'
>>> ifcopenshell.schema_identifier
'IFC2X3'
>>>
Re: IFC import fails in v0.19
Can you verify that this version of IFCOpenShell can actually handle IFC4? Earlier versions needed to be compiled for a specific IFC schema version, either IFC2x3 or IFC4. I believe the version included in releases is the one compiled for IFC2x3 so far. Try this to check:
Code: Select all
>>> import ifcopenshell
>>> ifcopenshell.schema_identifier
'IFC2X3'
>>> ifcopenshell.version
'0.5.0-dev'
Re: IFC import fails in v0.19
@hlg: cross post ... by the time you posted I edited my post ...
Just tested with ifcopenshell 0.6 which can handle IFC2x3 and IFC4 ...
>>> import ifcopenshell
>>> ifcopenshell.version
'0.6.0b0'
good news ...
Just tested with ifcopenshell 0.6 which can handle IFC2x3 and IFC4 ...
Code: Select all
import ifcopenshell
ifcopenshell.version
>>> ifcopenshell.version
'0.6.0b0'
good news ...
- Attachments
-
- Screenshot_20191104_123400.png (127.77 KiB) Viewed 2269 times
Re: IFC import fails in v0.19
find more informations in this regard here ... https://forum.freecadweb.org/viewtopic.php?p=311656
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: IFC import fails in v0.19
Thanks!