Skip to content

Commit

Permalink
Arch: import ifc, colors in IFC4 print warning not implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Oct 6, 2020
1 parent a299f23 commit 4c057c9
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/Mod/Arch/importIFCHelper.py
Expand Up @@ -439,24 +439,23 @@ def getColorFromStyledItem(styled_item):

# In current IFC release (IFC2x3) only one presentation style
# assignment shall be assigned.
# TODO: check IFC4

if len(styled_item.Styles) != 1:
# Normally, only one element in `Styles` should be available.
# In IFC4 `IfcPresentationStyleAssignment` is deprecated
# In IFC4 multiple styles are assigned to style in 'IfcStyleItem' instead

# print(ifcfile[p])
# print(styled_item)
# print(styled_item.Styles)
if len(styled_item.Styles) == 1:
# IN IFC2x3, only one element in `Styles` should be available.
_wrn("More than one 'Style' in 'IfcStyleItem', do nothing.")

# These two cases do nothing so we just comment them out.
# if len(styled_item.Styles) == 0:
# # ca 100x in 210_King_Merged.ifc
# # Empty styles, #4952778=IfcStyledItem(#4952779,(),$)
# # this is an error in the IFC file in my opinion
# # print(ifcfile[p])
# # print(styled_item)
# # print(styled_item.Styles)
# pass
# else:
# # Never seen an IFC with more than one element in `Styles`
# pass
# ca 100x in 210_King_Merged.ifc
# Empty styles, #4952778=IfcStyledItem(#4952779,(),$)
# this is an error in the IFC file in my opinion
elif len(styled_item.Styles) > 1:
# never seen an ifc with more than one Styles in IfcStyledItem
# the above seams to only apply for IFC2x3, IFC4 can have them
# see https://forum.freecadweb.org/viewtopic.php?f=39&t=33560&p=437056#p437056
_wrn("More than one 'Style' in 'IfcStyleItem', not implemented, do nothing.")
else:
# Get the `IfcPresentationStyleAssignment`, there should only be one,
if styled_item.Styles[0].is_a('IfcPresentationStyleAssignment'):
Expand Down

0 comments on commit 4c057c9

Please sign in to comment.