IFC Import, Windows

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

IFC Import, Windows

Post by bernd »

Just downloaded the latast version available for windows from http://sourceforge.net/projects/free-ca ... 0unstable/ its allready 2 Month old (3389). Just tested what happens if one tryes to import ifc in that version because if 0.14 is released may be some people will try to do.

FreeCAD uses the internal parser since ifcopenshell is not installed. On any ifc I have I get similar errors:

Code: Select all

Couldn't locate IfcOpenShell
IfcOpenShell not found or disabled, falling back on internal parser.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\importIFC.py", line 48, in open
    read(filename)
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\importIFC.py", line 357, in read
    ifc = ifcReader.IfcDocument(filename,schema=schema)
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\ifcReader.py", line 337, in __init__
    f = IfcFile(filename,schema)
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\ifcReader.py", line 169, in __init__
    self.entById, self.entsByName, self.header = self.read()
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\ifcReader.py", line 188, in read
    e = self.parseLine(line)
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\ifcReader.py", line 217, in parseLine
    return {"id": id, "name": name, "attributes": self.parseAttributes(name, attrs)}
  File "C:\Program Files (x86)\FreeCAD 0.14\Mod\Arch\ifcReader.py", line 235, in parseAttributes
    (len(schema_attributes), len(parts), ent_name)
<type 'exceptions.AssertionError'>: Expected 12 attributes, got 3 (entity: IFCAXIS2PLACEMENT3D
or

Code: Select all

...
<type 'exceptions.AssertionError'>: Expected 6 attributes, got 4 (entity: IFCSIUNIT
or

Code: Select all

...
<type 'exceptions.AssertionError'>: Expected 10 attributes, got 8 (entity: IFCPERSON
or

Code: Select all

...
<type 'exceptions.AssertionError'>: Expected 8 attributes, got 5 (entity: IFCORGANIZATION
...

Am I missing something?!
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC Import, Windows

Post by yorik »

Hm no, apparently your IFC file doens't comply with the schema... When the ifc importer starts for the first time, if ifcopenshell is not installed, the default (IFC2x3) IFC schema is downloaded. Each entity in the IFC file is then compared with the schema on import. Maybe try downloading an IFC4 schema (you need the .exp file, that you can get from buildingsmart.org), then in the Arch preferences you can give its path...

But I'm really considering if we shouldn't disable that internal parser, because it's a long time i didn't work on it and it will do a very poor job (only import a couple of very basic objects)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC Import, Windows

Post by bernd »

Thanks Yorik for your help.
yorik wrote:...But I'm really considering if we shouldn't disable that internal parser, because it's a long time i didn't work on it and it will do a very poor job (only import a couple of very basic objects)
+1
People install FreeCAD for windows and try to import ifc files and get error messages. I allready got asked by 2 friends because of this problem. If one really would like to use the internal parser this could be done from python ...
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IFC Import, Windows

Post by yorik »

Yes, that might be the best course of action: disable the internal parser when importing from the GUI (show an error message explaining that you need ifcopenshell) but leave it there so you can use it from python...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC Import, Windows

Post by bernd »

yorik wrote:Yes, that might be the best course of action: disable the internal parser when importing from the GUI (show an error message explaining that you need ifcopenshell) but leave it there so you can use it from python...
Exactly what I would prefer too.
Post Reply