mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Fix error unassigning type from element without representation
Traceback
Traceback (most recent call last):
File "\bonsai\bim\module\type\operator.py", line 63, in execute
return IfcStore.execute_ifc_operator(self, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\ifc.py", line 408, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\type\operator.py", line 78, in _execute
active_context = active_representation.ContextOfItems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ContextOfItems'
Error: Python: Traceback (most recent call last):
File "\bonsai\bim\ifc.py", line 408, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\type\operator.py", line 78, in _execute
active_context = active_representation.ContextOfItems
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ContextOfItems'
This commit is contained in:
@@ -74,11 +74,10 @@ class UnassignType(bpy.types.Operator):
|
|||||||
continue
|
continue
|
||||||
ifcopenshell.api.run("type.unassign_type", self.file, related_objects=[element])
|
ifcopenshell.api.run("type.unassign_type", self.file, related_objects=[element])
|
||||||
|
|
||||||
|
if element.Representation:
|
||||||
|
new_active_representation = None
|
||||||
active_representation = tool.Geometry.get_active_representation(obj)
|
active_representation = tool.Geometry.get_active_representation(obj)
|
||||||
active_context = active_representation.ContextOfItems
|
active_context = active_representation.ContextOfItems
|
||||||
new_active_representation = None
|
|
||||||
|
|
||||||
if element.Representation:
|
|
||||||
representations = []
|
representations = []
|
||||||
for representation in element.Representation.Representations:
|
for representation in element.Representation.Representations:
|
||||||
resolved_representation = ifcopenshell.util.representation.resolve_representation(representation)
|
resolved_representation = ifcopenshell.util.representation.resolve_representation(representation)
|
||||||
|
|||||||
Reference in New Issue
Block a user