mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +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:
|
||||
return
|
||||
for r in element.RepresentationMaps:
|
||||
subcontexts.append('{}/{}/{}'.format(
|
||||
r.MappedRepresentation.ContextOfItems.ContextType or '',
|
||||
r.MappedRepresentation.ContextOfItems.ContextIdentifier or '',
|
||||
r.MappedRepresentation.ContextOfItems.TargetView or ''))
|
||||
if r.MappedRepresentation.ContextOfItems.is_a('IfcGeometricRepresentationSubContext'):
|
||||
subcontexts.append('{}/{}/{}'.format(
|
||||
r.MappedRepresentation.ContextOfItems.ContextType 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)
|
||||
for subcontext in subcontexts:
|
||||
representation_context = obj.BIMObjectProperties.representation_contexts.add()
|
||||
|
||||
Reference in New Issue
Block a user