mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Fix #4076. Fix bug where drawing activation priorities didn't match drawing generation priorities, and switching to a text literal representation failed.
This commit is contained in:
@@ -106,6 +106,9 @@ def switch_representation(
|
|||||||
entity = ifc.get_entity(obj)
|
entity = ifc.get_entity(obj)
|
||||||
current_obj_data = geometry.get_object_data(obj)
|
current_obj_data = geometry.get_object_data(obj)
|
||||||
|
|
||||||
|
if not current_obj_data and geometry.is_text_literal(representation):
|
||||||
|
return
|
||||||
|
|
||||||
has_openings = apply_openings and getattr(entity, "HasOpenings", None)
|
has_openings = apply_openings and getattr(entity, "HasOpenings", None)
|
||||||
if has_openings:
|
if has_openings:
|
||||||
# if it has openings make sure to switch to element's mapped representation
|
# if it has openings make sure to switch to element's mapped representation
|
||||||
|
|||||||
@@ -1636,11 +1636,32 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
|
|
||||||
subcontexts = []
|
subcontexts = []
|
||||||
target_view = cls.get_drawing_target_view(drawing)
|
target_view = cls.get_drawing_target_view(drawing)
|
||||||
context_filters = [("Model", "Body", target_view), ("Model", "Body", "MODEL_VIEW")]
|
|
||||||
if target_view in ("PLAN_VIEW", "REFLECTED_PLAN_VIEW"):
|
if target_view in ("PLAN_VIEW", "REFLECTED_PLAN_VIEW"):
|
||||||
plan_contexts = [("Plan", "Body", target_view), ("Plan", "Body", "MODEL_VIEW")]
|
context_filters = [
|
||||||
plan_contexts.extend(context_filters)
|
("Plan", "Body", target_view),
|
||||||
context_filters = plan_contexts
|
("Plan", "Body", "MODEL_VIEW"),
|
||||||
|
("Plan", "Facetation", target_view),
|
||||||
|
("Plan", "Facetation", "MODEL_VIEW"),
|
||||||
|
("Model", "Body", target_view),
|
||||||
|
("Model", "Body", "MODEL_VIEW"),
|
||||||
|
("Model", "Facetation", target_view),
|
||||||
|
("Model", "Facetation", "MODEL_VIEW"),
|
||||||
|
("Plan", "Annotation", target_view),
|
||||||
|
("Plan", "Annotation", "MODEL_VIEW"),
|
||||||
|
("Model", "Annotation", target_view),
|
||||||
|
("Model", "Annotation", "MODEL_VIEW"),
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
context_filters = [
|
||||||
|
("Model", "Body", target_view),
|
||||||
|
("Model", "Body", "MODEL_VIEW"),
|
||||||
|
("Model", "Facetation", target_view),
|
||||||
|
("Model", "Facetation", "MODEL_VIEW"),
|
||||||
|
("Model", "Annotation", target_view),
|
||||||
|
("Model", "Annotation", "MODEL_VIEW"),
|
||||||
|
]
|
||||||
|
|
||||||
for context_filter in context_filters:
|
for context_filter in context_filters:
|
||||||
subcontext = ifcopenshell.util.representation.get_context(tool.Ifc.get(), *context_filter)
|
subcontext = ifcopenshell.util.representation.get_context(tool.Ifc.get(), *context_filter)
|
||||||
if subcontext:
|
if subcontext:
|
||||||
|
|||||||
@@ -586,6 +586,10 @@ class Geometry(blenderbim.core.tool.Geometry):
|
|||||||
"SweptSolid",
|
"SweptSolid",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def is_text_literal(cls, representation):
|
||||||
|
return bool([i for i in representation.Items if i.is_a("IfcTextLiteral")])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_type_product(cls, element):
|
def is_type_product(cls, element):
|
||||||
return element.is_a("IfcTypeProduct")
|
return element.is_a("IfcTypeProduct")
|
||||||
|
|||||||
Reference in New Issue
Block a user