IfcOpenShell Error

This forum section is only for IFC-related issues
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: IfcOpenShell Error

Post by chakkree »

mezeq79 wrote: GoogleDrive Link https://drive.google.com/file/d/0B5lAIA ... sp=sharing for IFC file i need to open.
I already download project2.ifc(twice for sure).
At first, I tested by open with BIM Vision and Solibri Model Viewer. The result, both is can not open an ifc file.(Very Strange)

Next, open "project2.ifc" with NotePad++. Found that an image below.
Some Error is from the export process, about line no.83416.
It's not a pure text file. There is no any program to open this file.
IFC_not_complete_Export.PNG
IFC_not_complete_Export.PNG (139.39 KiB) Viewed 3403 times
mezeq79
Posts: 7
Joined: Tue Jul 26, 2016 4:32 pm
Location: Argentina

Re: IfcOpenShell Error

Post by mezeq79 »

@chakkree

I checked file with leafpad (a notepad for lubuntu) and foundo no problem.

I uploaded file again, here is the new link : https://drive.google.com/open?id=0B5lAI ... UVmV1hmQUU

But i think that problem has nothing to do with file, because no matter if i try to open my file o IFCOpenHouse.ifc i get the same error in freecad 0.16 and freecad-daily 0.17
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IfcOpenShell Error

Post by yorik »

@mezeq79 this error of yours:

Code: Select all

products = ifcfile.by_type(ROOT_ELEMENT)
...
<type 'exceptions.RuntimeError'>: Unable to find find keyword in schema
means that the root element (the "highest level" IFC element to import) is not found in the IFC schema. The default root element should be "IfcProduct", it can be changed in the Ifc preferences. Please check that you didn't change it by accident? If needed reset it to IfcProduct (or leave the field empty, which should set it to IfcProduct automatically)
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: IfcOpenShell Error

Post by sgrogan »

bernd wrote:You should first be sure your FreeCAD and IfcOpenShell are able to open ifc files at all before trying to open a huge special ifc-file.Try the IfcOpenHouse file:
This is of course a great idea. I would like to update the wiki to add this check after the "import IfcImport" check. Should I include bernd's advise to change the preferences? or should that be the default preference? I don't really know the implications.
"fight the good fight"
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: IfcOpenShell Error

Post by saso »

good, but if we could add few ifc related unit tests it would be even better :roll:
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: IfcOpenShell Error

Post by sgrogan »

saso wrote:good, but if we could add few ifc related unit tests it would be even better :roll:
Agreed but, ifc isn't a core dependency. We would have to at least make a Ubuntu ifcopenshell python27 package and OSX too. The Ubuntu package is already on my list, as a PPA, hosted either standalone or on the FreeCAD community extras page. On Windows it's bundled but I'm behind keeping it current. bernd has posted a more recent build though for x64. viewtopic.php?f=23&t=16475#p131460
"fight the good fight"
mezeq79
Posts: 7
Joined: Tue Jul 26, 2016 4:32 pm
Location: Argentina

Re: IfcOpenShell Error

Post by mezeq79 »

@yorik you were right.

The Root Element in preferences from Arch workbench was set to 'ProductoIfc' which is the spanish translation of 'IfcProduct'.
As soon as i changed it it worked for both Freecad and Freecad-Daily.

The problem is that i didn't change it, because i didn't even knew of its existance, so i suppose it has to be a problem with Spanish language package?

Can it be cosidered as a minor bug and send to Spanish developers?

Appreciate all your help.
Thank you very much
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: IfcOpenShell Error

Post by saso »

sgrogan wrote:
saso wrote:good, but if we could add few ifc related unit tests it would be even better :roll:
Agreed but, ifc isn't a core dependency.
good point :oops:
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: IfcOpenShell Error

Post by sgrogan »

mezeq79 wrote:@yorik you were right.
Common occurrence in FreeCAD. The experts did notice :D
Sorry @mezeq79 for high-jacking your thread :oops: Great question though that fosters a new discussion viewtopic.php?f=23&t=16785
"fight the good fight"
mezeq79
Posts: 7
Joined: Tue Jul 26, 2016 4:32 pm
Location: Argentina

Re: IfcOpenShell Error

Post by mezeq79 »

It would be good than this error and solution to spanish Freecad installation stays clear.

Error on every Ifc file:
products = ifcfile.by_type(ROOT_ELEMENT)
...
<type 'exceptions.RuntimeError'>: Unable to find find keyword in schema
Says that ROOT_ELEMENT is not set to IfcProduct on Freecad.

If you are using any of Freecad "spanish translated" versions, must check in "Edit->Preferences->Import/Export->Ifc" of Arch workbench ROOT_ELEMENT value.

It must be kept empty or write 'IfcProduct' because there is a translation error.

Thank you
Post Reply