Errror: importIFC test failed

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
Post Reply
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Errror: importIFC test failed

Post by teobo »

Hello,
when test importing one of the ifc-houses I get the error message:

Code: Select all

import importIFC
importIFC.DEBUG = True
path=""

>>> importIFC.open(path+"window-house--Allplan2012.ifc")
openingwindow-house--Allplan2012.ifc...
Parsed from schema /home/kubuntu/.FreeCAD/ifc4.exp: 766 entities and 126 types


Couldn't locate IfcOpenShell
IfcOpenShell not found or disabled, falling back on internal parser.

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/kubuntu/.FreeCAD/Mod/Arch/importIFC.py", line 59, in open
    read(filename,skip)
  File "/home/kubuntu/.FreeCAD/Mod/Arch/importIFC.py", line 387, in read
    ifc = ifcReader.IfcDocument(filename,schema=schema)
  File "/home/kubuntu/.FreeCAD/Mod/Arch/ifcReader.py", line 337, in __init__
    f = IfcFile(filename,schema)
  File "/home/kubuntu/.FreeCAD/Mod/Arch/ifcReader.py", line 169, in __init__
    self.entById, self.entsByName, self.header = self.read()
  File "/home/kubuntu/.FreeCAD/Mod/Arch/ifcReader.py", line 188, in read
    e = self.parseLine(line)
  File "/home/kubuntu/.FreeCAD/Mod/Arch/ifcReader.py", line 217, in parseLine
    return {"id": id, "name": name, "attributes": self.parseAttributes(name, attrs)}
  File "/home/kubuntu/.FreeCAD/Mod/Arch/ifcReader.py", line 235, in parseAttributes
    (len(schema_attributes), len(parts), ent_name)
AssertionError: Expected 5 attributes, got 4 (entity: IFCCURVESTYLE
>>> App.setActiveDocument("window_house__Allplan2012")
>>> App.ActiveDocument=App.getDocument("window_house__Allplan2012")
>>> Gui.ActiveDocument=Gui.getDocument("window_house__Allplan2012")

I installed ifcopenshell before

Code: Select all

..
-- Installing: /usr/local/bin/IfcConvert
-- Removed runtime path from "/usr/local/bin/IfcConvert"
-- Installing: /usr/local/lib/libIfcParse.a
-- Installing: /usr/local/lib/libIfcGeom.a
...
OS: Ubuntu 14.04.1 LTS
Word size: 64-bit
Version: 0.15.3782 (Git)
Branch: master
Hash: f0eb27f710aa74adf744d05fdf8c5d5ace62d386
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Errror: importIFC test failed

Post by yorik »

Installing IfcOpenShell is a bit more than copying these files, there are python bindings too.
to make sure IfcOpenShell is properly installed, try this from a python console:

Code: Select all

import IfcImport
If nothing happens, then ifcopenshell is correctly installed. But apparently it is not...
The internal parser is indeed very buggy and anyway very limited, it will be removed in next versions...
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Errror: importIFC test failed

Post by saso »

yorik wrote:Installing IfcOpenShell is a bit more than copying these files, there are python bindings too.
What would have to be done for IfcOpenShell to be seamlessly integrated in FreeCAD? IMO this will be an important step for Arch WB.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Errror: importIFC test failed

Post by yorik »

Basically people willing to compile and pack ifcopenshell for windows...
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: Errror: importIFC test failed

Post by teobo »

So I give it a new try and start from scratch:

Code: Select all

 http://ifcopenshell.org/code.html
 svn co https://svn.code.sf.net/p/ifcopenshell/svn/trunk ifcopenshell
 cd ifcopenshell/cmake
  cat ~/ifcopenshell/README 
  mkdir build
  cd build
  kubuntu@kubuntu:~/ifcopenshell/cmake/build$ cmake ../
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   program_options
-- Boost include files found in /usr/include
-- Boost libraries found in /usr/lib/x86_64-linux-gnu
-- Looking for opencascade include files in: /usr/include/opencascade <-
-- Use OCC_INCLUDE_DIR to specify another directory
CMake Error at CMakeLists.txt:22 (MESSAGE):
  Unable to find header files, aborting


-- Configuring incomplete, errors occurred!
See also "/home/kubuntu/ifcopenshell/cmake/build/CMakeFiles/CMakeOutput.log".
kubuntu@kubuntu:~/ifcopenshell/cmake/build$ find /usr/ -name "*opencascad*"


So it appears that the make script does not find opencascade, maybe some of you know where are the requested file respectively which ubuntu packages are providing them?
Tia

Code: Select all

OS: Ubuntu 14.04.1 LTS
Word size: 64-bit
Version: 0.15.3854 (Git)
Branch: master
Hash: 9a0d73a2b68769b80b1abb101184d72edeebfa2e
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Errror: importIFC test failed

Post by yorik »

Aren't there build instructions on the ifcopenshell website?

Otherwise:
dpkg -l | grep -i opencascad gives you what opencascade-related packages are installed on your system.
dpkg -L packagename gives you the file installed by a given package. Try with any of the -dev packages, they usually contain the /usr/include stuff, and figure out where they do. In my case it's in /usr/include/oce
use cmake-gui in the build dir to correct the OCC_INCLUDE_DIR variable
Post Reply