FreeCAD does not import colors for IFC form Allplan
FreeCAD does not import colors for IFC form Allplan
Allplan has two exporter, attached a green column exported with each of the exporters. FreeCAD does not read the colors. Both are grey. I may have a look myself, but this will probably not happen before a release 0.18. To much to do in FEM ...
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15572 (Git)
Build type: Release
Branch: master
Hash: ab1f4c442d443adae106a2ea1ed877f33db86154
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15572 (Git)
Build type: Release
Branch: master
Hash: ab1f4c442d443adae106a2ea1ed877f33db86154
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
Re: FreeCAD does not import colors for IFC form Allplan
this file follows a scheme I hadn't seen before (the IfcStyledItem doesn't say which item it styles)... There is a quite complex system in that file, with drafting styles. We should open a mantis issue for this so we dont forget
Re: FreeCAD does not import colors for IFC form Allplan
started an implementation ... https://github.com/berndhahnebach/FreeC ... /ifccolors
Re: FreeCAD does not import colors for IFC form Allplan
git commit 2d1f6ab1a22 fixed the problem of the first post.
Re: FreeCAD does not import colors for IFC form Allplan
new problems. If the new Allplan exporter and IFC4 is used the import breaks ...
Code: Select all
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22522 (Git)
Build type: Release
Branch: master
Hash: d8e476ef428017900dfe0f9359ba448503c216f9
Python version: 3.8.5
Qt version: 5.12.6
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Switzerland (de_CH)
Code: Select all
14:19:45 Opening 'C:/Users/BHA/Desktop/new_exporter_IfC4.ifc'... done.
14:19:45 Building types and relationships table...
14:19:45 More than one 'Style' in 'IfcStyleItem', do nothing.
14:19:45 done.
14:19:45 Parsing 2 BIM objects...
14:19:45 1 / 2 object #89 : IfcSite (arch) no brep : Diverses
14:19:45 2 / 2 object #166 : IfcColumn no layer found IfcColumn (arch) 2k 1 solids : Stuetze
14:19:45 Processing Struct relationships...done
14:19:45 Processing Arch relationships...
14:19:45 adding 1 object(s) to Diverses
14:19:45 adding 1 object(s) to Project
14:19:45 Creating materials...Traceback (most recent call last):
File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx-Win-Conda\Mod\Arch\ArchMaterial.py", line 297, in onChanged
c = tuple([float(f) for f in obj.Material['DiffuseColor'].strip("()").strip("[]").split(",")])
File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx-Win-Conda\Mod\Arch\ArchMaterial.py", line 297, in <listcomp>
c = tuple([float(f) for f in obj.Material['DiffuseColor'].strip("()").strip("[]").split(",")])
<class 'ValueError'>: could not convert string to float: 'None'
14:19:45 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx-Win-Conda\Mod\Arch\importIFC.py", line 1303, in insert
col = tuple([float(f) for f in string_color.strip("()").split(",")])
File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx-Win-Conda\Mod\Arch\importIFC.py", line 1303, in <listcomp>
col = tuple([float(f) for f in string_color.strip("()").split(",")])
<class 'ValueError'>: could not convert string to float: 'None'
Re: FreeCAD does not import colors for IFC form Allplan
the origin of the problem is a color table with None ectries: https://github.com/FreeCAD/FreeCAD/blob ... FC.py#L351
Eventually the color string is "None" which is impossible to be converted in a FreeCAD color. But it is intended to write None ... https://github.com/FreeCAD/FreeCAD/blob ... er.py#L375
Which means adaption here is needed: https://github.com/FreeCAD/FreeCAD/blob ... 1264-L1269 the None will be written into "DiffuseColor" attribute of material objects material dict.
Eventually the color string is "None" which is impossible to be converted in a FreeCAD color. But it is intended to write None ... https://github.com/FreeCAD/FreeCAD/blob ... er.py#L375
Which means adaption here is needed: https://github.com/FreeCAD/FreeCAD/blob ... 1264-L1269 the None will be written into "DiffuseColor" attribute of material objects material dict.
Re: FreeCAD does not import colors for IFC form Allplan
git commit 8292664f4943
colors for IFC4 export of Allplan are still not imported, because they all are None returned, but at least they do not break the import.
colors for IFC4 export of Allplan are still not imported, because they all are None returned, but at least they do not break the import.
Re: FreeCAD does not import colors for IFC form Allplan
https://github.com/FreeCAD/FreeCAD/blob ... er.py#L458
this is true for IFC2x3 but not for IFC4 ...
IFC2x3 example from above
IFC4 example from above
Code: Select all
# Never seen an IFC with more than one element in `Styles`
IFC2x3 example from above
Code: Select all
#116= IFCSTYLEDITEM(#97,(#107),$);
#107= IFCPRESENTATIONSTYLEASSIGNMENT((#109,#112));
#109= IFCCURVESTYLE($,#110,$,#111);
#112= IFCSURFACESTYLE('_hb_n_btl_be_beton_188',.BOTH.,(#114));
IFC4 example from above
Code: Select all
#141= IFCSTYLEDITEM(#131,(#143,#146),$);
#143= IFCCURVESTYLE($,#144,$,#145,$);
#146= IFCSURFACESTYLE('_hb_n_btl_be_beton_188',.BOTH.,(#148));