Fix regression from 744c08e where type products cannot have an instance specified in create_shape

This commit is contained in:
Dion Moult
2023-10-20 12:24:57 +11:00
parent 0e4bc320cb
commit 074de2741a
+10 -1
View File
@@ -480,7 +480,16 @@ class Geometry(blenderbim.core.tool.Geometry):
settings = ifcopenshell.geom.settings() settings = ifcopenshell.geom.settings()
settings.set(settings.WELD_VERTICES, True) settings.set(settings.WELD_VERTICES, True)
context = representation.ContextOfItems context = representation.ContextOfItems
if element.is_a("IfcTypeProduct") or not apply_openings:
if element.is_a("IfcTypeProduct"):
# You may only specify a single representation when creating shapes for types
try:
shape = ifcopenshell.geom.create_shape(settings, representation)
except:
settings.set(settings.INCLUDE_CURVES, True)
shape = ifcopenshell.geom.create_shape(settings, representation)
else:
if not apply_openings:
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True) settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True)
if context.ContextIdentifier == "Body" and context.TargetView == "MODEL_VIEW": if context.ContextIdentifier == "Body" and context.TargetView == "MODEL_VIEW":