mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Fix bug where mapped representations belonging to a context fails to import
This commit is contained in:
@@ -1233,10 +1233,16 @@ class IfcImporter():
|
|||||||
if not element.RepresentationMaps:
|
if not element.RepresentationMaps:
|
||||||
return
|
return
|
||||||
for r in element.RepresentationMaps:
|
for r in element.RepresentationMaps:
|
||||||
subcontexts.append('{}/{}/{}'.format(
|
if r.MappedRepresentation.ContextOfItems.is_a('IfcGeometricRepresentationSubContext'):
|
||||||
r.MappedRepresentation.ContextOfItems.ContextType or '',
|
subcontexts.append('{}/{}/{}'.format(
|
||||||
r.MappedRepresentation.ContextOfItems.ContextIdentifier or '',
|
r.MappedRepresentation.ContextOfItems.ContextType or '',
|
||||||
r.MappedRepresentation.ContextOfItems.TargetView or ''))
|
r.MappedRepresentation.ContextOfItems.ContextIdentifier or '',
|
||||||
|
r.MappedRepresentation.ContextOfItems.TargetView or ''))
|
||||||
|
else:
|
||||||
|
subcontexts.append('{}/{}/{}'.format(
|
||||||
|
r.MappedRepresentation.ContextOfItems.ContextType or '',
|
||||||
|
r.MappedRepresentation.ContextOfItems.ContextIdentifier or '',
|
||||||
|
''))
|
||||||
subcontexts = set(subcontexts)
|
subcontexts = set(subcontexts)
|
||||||
for subcontext in subcontexts:
|
for subcontext in subcontexts:
|
||||||
representation_context = obj.BIMObjectProperties.representation_contexts.add()
|
representation_context = obj.BIMObjectProperties.representation_contexts.add()
|
||||||
|
|||||||
Reference in New Issue
Block a user