UTF issue with ifc import

This forum section is only for IFC-related issues
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

UTF issue with ifc import

Post by hardeeprai »

On trying to import

https://raw.githubusercontent.com/Great ... TDP202.ifc

file I get following error:
Exception (Sat Nov 10 20:18:02 2018): UTF8 conversion failure at PropertyString::getPyObject()
Traceback (most recent call last):
File "/usr/lib/freecad-daily/Mod/Arch/ArchBuildingPart.py", line 610, in onChanged
self.onChanged(vobj,"ShowUnit")
File "/usr/lib/freecad-daily/Mod/Arch/ArchBuildingPart.py", line 620, in onChanged
txt += vobj.Object.Label
<class 'Base.FreeCADError'>: UTF8 conversion failure at PropertyString::getPyObject()
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/freecad-daily/Mod/Arch/importIFC.py", line 823, in insert
a["IfcUID"] = str(guid)
<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)


What could be the issue?

Looks some utf issue as well.

ifcopenshell.version is : '0.5.0-dev' and other details is:

OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15162 (Git)
Build type: Release
Branch: master
Hash: 1d72ee43435fa099ae97a2f6e3d15a225d4f32d3
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
--
H.S.Rai
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: UTF issue with ifc import

Post by yorik »

I did a series of fixes yesterday in the IFC importer/exporter related to python3 and encoding. This file now opens fine for me... I suppose the cause was solved together...
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: UTF issue with ifc import

Post by hardeeprai »

yorik wrote: Sat Nov 10, 2018 8:50 pm I did a series of fixes yesterday in the IFC importer/exporter related to python3 and encoding. This file now opens fine for me... I suppose the cause was solved together...
I still got similar error, on importing following file:
https://github.com/openBIMstandards/Da ... c?raw=true
Exception (Sun Nov 11 07:26:11 2018): UTF8 conversion failure at PropertyString::getPyObject()
Traceback (most recent call last): File "/usr/lib/freecad-daily/Mod/Arch/ArchBuildingPart.py", line 613, in onChanged self.onChanged(vobj,"ShowUnit")
File "/usr/lib/freecad-daily/Mod/Arch/ArchBuildingPart.py", line 623, in onChanged txt += vobj.Object.Label
<class 'Base.FreeCADError'>: UTF8 conversion failure at PropertyString::getPyObject() Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/freecad-daily/Mod/Arch/importIFC.py", line 831, in insert a["IfcUID"] = str(guid) <type'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
freecad-daily is already the newest version (0.18~beta1+git201811101427~ubuntu16.04.1)

which suggests that it was built on Nov 10 2018, while as per following (About FreeCAD) release date is 2018/11/08 19:56:21 (this is not copied from "copy to clipboard" from "About FreeCAD"). This is the same version, which is built about 10 hours ago, as per:

https://launchpad.net/~freecad-maintain ... _state=all

About FreeCAD
OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15169 (Git)
Build type: Release
Branch: master
Hash: 7d197ce829600e308dd0e85aeb1a4ac9376ff286
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
--
H.S.Rai
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: UTF issue with ifc import

Post by hardeeprai »

hardeeprai wrote: Sun Nov 11, 2018 2:45 am I still got similar error, on importing following file:
On trying other file: https://raw.githubusercontent.com/Great ... TDP202.ifc as reported earlier, getting same file. System hangs I need to kill application.

Also see name of site and project in screenshot.

utfFC.png
utfFC.png (16.14 KiB) Viewed 2776 times
--
H.S.Rai
cadgiru
Posts: 91
Joined: Thu Oct 27, 2016 9:53 am
Location: Norway
Contact:

Re: UTF issue with ifc import

Post by cadgiru »

At least to others have reported similar issue.
It looks to me like the only common denominator is various versions of Ubuntu.

Some related posts:
regards
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: UTF issue with ifc import

Post by yorik »

Strange, I don't get this error here. But my freecad version is now switched to python3, I'll rebuild a python2 to test.
The Schependomlaan file takes about one hour to import here on my machine, and crashes at the end. But it's a really big file. I'll do some more testing with it, see if I can optimize things a bit...
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: UTF issue with ifc import

Post by hardeeprai »

yorik wrote: Sun Nov 11, 2018 9:53 pm The Schependomlaan file takes about one hour to import here on my machine, and crashes at the end. But it's a really big file. I'll do some more testing with it, see if I can optimize things a bit...
So real testing begins ;-)

FreeCAD will be maturing fast in BIM :-)
--
H.S.Rai
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: UTF issue with ifc import

Post by yorik »

Yes, this file is a very good "target": We should be able to import it reasonably fast, and there should be no problem in working with files of that kind of complexity in FreeCAD.
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: UTF issue with ifc import

Post by hardeeprai »

yorik wrote: Sun Nov 11, 2018 9:53 pm Strange, I don't get this error here. But my freecad version is now switched to python3, I'll rebuild a python2 to test.
The Schependomlaan file takes about one hour to import here on my machine, and crashes at the end. But it's a really big file. I'll do some more testing with it, see if I can optimize things a bit...
Schependomlaan file took about 3 minutes to check-in on BIM Server at gdy.club/BIM

If anyone wish to have account there (for limited experimentation), can create account there and send PM for more access / privileges.
--
H.S.Rai
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: UTF issue with ifc import

Post by yorik »

It takes about 5 seconds in Ifc++. But that's not a very good comparison, because ifc++ does a very simple import. But nevertheless, there is a huge difference. I'll also test in other BIM apps such as Revit and ArchiCAD, that should give us a good idea of where we should arrive...
Post Reply