Code: Select all
OS: Ubuntu 18.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22219 (Git)
Build type: Release
Branch: master
Hash: 4ce85d39d394abf7844754e839631e3c8308ac7d
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Code: Select all
>>> ifcopenshell.version
'0.6.0b0'
The color may be an IfcColourRgb and have RGB numeric values
Code: Select all
IfcColourRgb.Red
IfcColourRgb.Green
IfcColourRgb.Blue
Code: Select all
IfcDraughtingPreDefinedColour.Name == 'red'
IfcDraughtingPreDefinedColour.Name == 'blue'
IfcDraughtingPreDefinedColour.Name == 'black'
etc.
The predefined color names currently are not handled by our IFC importer, which causes an error.
Code: Select all
Opening /opt/freecad-build-debug-vocx/ifc_s/01_KIT_IFC_examples_IFC4/AC20-Institute-Var-2.ifc ...Building types and relationships table...Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/freecad-build-main/Mod/Arch/importIFC.py", line 209, in open
doc = insert(filename, doc.Name, skip, only, root)
File "/opt/freecad-build-main/Mod/Arch/importIFC.py", line 327, in insert
colors = importIFCHelper.buildRelProductColors(ifcfile, prodrepr)
File "/opt/freecad-build-main/Mod/Arch/importIFCHelper.py", line 334, in buildRelProductColors
colors[p] = getColorFromStyledItem(styled_item)
File "/opt/freecad-build-main/Mod/Arch/importIFCHelper.py", line 425, in getColorFromStyledItem
col = [rgb_color.Red, rgb_color.Green, rgb_color.Blue]
File "/home/vocx/.local/lib/python3.6/site-packages/ifcopenshell/entity_instance.py", line 65, in __getattr__
"entity instance of type '%s' has no attribute '%s'" % (self.wrapped_data.is_a(), name))
<class 'AttributeError'>: entity instance of type 'IfcDraughtingPreDefinedColour' has no attribute 'Red'
Code: Select all
PREDEFINED_RGB = {'black': (0, 0, 0),
'red': (1.0, 0, 0),
'green': (0, 1.0, 0),
'blue': (0, 0, 1.0),
'yellow': (1.0, 1.0, 0),
'magenta': (1.0, 0, 1.0),
'cyan': (0, 1.0, 1.0),
'white': (1.0, 1.0, 1.0)}
We are testing using KIT IFC Examples (IFC4). In this case the error is triggered by "Office Building", AC20-Institute-Var-2.ifc (10 MB).
If you have other failing IFC files made with Revit or Archicad, let me know so I can take a look at it.