Import IFC
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Import IFC
I wan’t to import a IFC file into FreeCAD, I drop the EXP file in %userprofile%\AppData\Roaming\FreeCAD but I get this message, can you help me
Re: Import IFC
Werner wrote:Hello Erwin,
I tested your file and I can confirm the error message. Since the ifc parser is written in Python this shows you the complete stack trace:
Couldn't locate IfcOpenShell
IfcOpenShell not found, falling back on internal parser.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\importIFC.py", line 57, in insert
read(filename)
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\importIFC.py", line 260, in read
ifc = ifcReader.IfcDocument(filename,schema=schema,debug=DEBUG)
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\ifcReader.py", line 327, in __init__
f = IfcFile(filename,schema)
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\ifcReader.py", line 161, in __init__
self.entById, self.entsByName, self.header = self.read()
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\ifcReader.py", line 180, in read
e = self.parseLine(line)
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\ifcReader.py", line 209, in parseLine
return {"id": id, "name": name, "attributes": self.parseAttributes(name, attrs)}
File "C:\Projects\FreeCAD-git\x64\Mod\Arch\ifcReader.py", line 227, in parseAttributes
(len(schema_attributes), len(parts), ent_name)
<type 'exceptions.AssertionError'>: Expected 6 attributes, got 4 (entity: IFCAPPLICATION
Unfortunately, I was never working on the ifc importer and doesn't know anything about the ifc format. So, I think it's best to ask Yorik because he has written the major part of it.
Regards,
Werner
Re: Import IFC
You should not use the internal parser. Use ifcopenshell instead. http://www.freecadweb.org/wiki/index.ph ... cOpenShell Normaly I do not have any problems even with huge an really complex ifc-bim-models to import to FreeCAD. Just some elements are missing sometimes.
I just tried to open your file using freecad 0.14 from github and ifcopenshell and got the following error:
I don't know If it is a FreeCAD or ifcopenshell issue. I would recommend the same as werner ask yorik.
Bernd
I just tried to open your file using freecad 0.14 from github and ifcopenshell and got the following error:
Code: Select all
Cannot compute Inventor representation for the shape of SEEH_Intl_School_of_Creete.
Bernd
Re: Import IFC
OK, this means that the shape is null and thus the tessellation/polygonization algorithm fails.Cannot compute Inventor representation for the shape of SEEH_Intl_School_of_Creete.
Re: Import IFC
Just opened your ifc in an editor and saw your file uses the new ifc standard IFC4, even an RC-Version.
I don't know if neither freecad or ifcopenshell supports the new ifc-release allready. I would recommend to try the ifc-version IFC2X3
Bernd
Code: Select all
FILE_SCHEMA (('IFC4RC4'));
Bernd
Re: Import IFC
I had a look at your file too, indeed it's an ifc4, and it is not supported by ifcopenshell yet. In theory since ifc4 is an extension of ifc3, ifcopenshell should be able to parse it, and indeed it does... The problem is that the file uses some entities not defined in ifc3, such as IfcCompositeCurve. Therefore it creates an invalid shape. If this is an important matter to you, I suggest you contact Thomas Krijnen, the author of IfcOpenShell, to see what can be done.
And the internal parser will be too weak to support this I'm afraid... But I'll do a test with the IFC4 schema you provided...
Also it's interesting that this IFC files defines a building which has a shape representation directly attached to it... Never seen that before.
And the internal parser will be too weak to support this I'm afraid... But I'll do a test with the IFC4 schema you provided...
Also it's interesting that this IFC files defines a building which has a shape representation directly attached to it... Never seen that before.
Re: Import IFC
It seams the file consists only one element ?!? Attached a viewer screen. The red, blue and green cylinders are the koordinate axis.
Bernd
Bernd
- Attachments
-
- screen.jpg (211.09 KiB) Viewed 4940 times
Re: Import IFC
It is a weird file indeed... It contains both elements that are only in IFC4, such as IfcCompositeCurve, and elements that have apparently been removed from IFC4, such as IfcGeneralProfileProperties... I'm surprised you found an app able to open it Bernd. I didn't know about that ifcplusplus, I'll try at once...
Re: Import IFC
I have been trying to get in contact with the developer because ifcplusplus is open source. A while ago it even was available on linux (former name was ifcgears) but the developer is no longer providing linux binary. He said it is to much afford to maintain the cmake files. I wrote him that I am really interested in a linux version because there is no ifc viewer on linux out there. By the way ifcplusplus is fast, reeeeeeeeaaaaaaaally fast. I post here if I get more infos. Berndyorik wrote:... I'm surprised you found an app able to open it Bernd. I didn't know about that ifcplusplus, I'll try at once...
EDIT: the links may help to find it faster.
https://code.google.com/p/ifcplusplus/
Re: Import IFC
Yes there is no way to build it on linux unfortunately, only with visual studio on windows. Too bad!
As an ifc viewer on linux I currently use this: http://www.ifctoolsproject.com/ but it's not very convenient...
As an ifc viewer on linux I currently use this: http://www.ifctoolsproject.com/ but it's not very convenient...