Display TargetScale in Contexts UI / edit target scale denominator (#6816)

This commit is contained in:
falken10vdl
2025-06-27 07:48:14 +02:00
committed by GitHub
parent efb3b9d255
commit 2698ba69d5
6 changed files with 55 additions and 1 deletions
@@ -26,6 +26,7 @@ def add_context(
context_type: Optional[ifcopenshell.util.representation.CONTEXT_TYPE] = None,
context_identifier: Optional[ifcopenshell.util.representation.REPRESENTATION_IDENTIFIER] = None,
target_view: Optional[ifcopenshell.util.representation.TARGET_VIEW] = None,
target_scale: Optional[float] = None,
parent: Optional[ifcopenshell.entity_instance] = None,
) -> ifcopenshell.entity_instance:
"""Adds a new geometric representation context
@@ -107,6 +108,9 @@ def add_context(
the common target views above or consult the IFC documentation
(under the IfcShapeRepresentation page) for more details. Optional
for contexts, but mandatory for subcontexts.
:param target_scale: It defines the intended scale at which the representation
is designed to be viewed or printed
:type target_scale: float, optional
:param parent: the parent context. Must be left as None (the default)
for contexts, and only set for subcontexts. Note that there are only
contexts and subcontexts, a subcontext cannot have any children.
@@ -186,6 +190,7 @@ def add_context(
"parent": parent,
"context_identifier": context_identifier,
"target_view": target_view,
"target_scale": target_scale,
}
return usecase.execute()
@@ -221,6 +226,7 @@ class Usecase:
"ContextType": self.settings["context_type"],
"ParentContext": self.settings["parent"],
"TargetView": self.settings["target_view"],
"TargetScale": self.settings["target_scale"],
}
)