This commit is contained in:
Andrej730
2025-02-21 14:40:41 +05:00
parent 69535c53e0
commit cf1647a451
4 changed files with 4 additions and 4 deletions
@@ -143,5 +143,5 @@ class Usecase:
def set_task_duration(self, duration: float) -> None:
if not (task_time := self.task.TaskTime):
ifcopenshell.api.sequence.add_task_time(self.file, task=self.task)
task_time = ifcopenshell.api.sequence.add_task_time(self.file, task=self.task)
task_time.ScheduleDuration = f"P{duration}D"
@@ -76,7 +76,6 @@ def edit_surface_style(
class Usecase:
file: ifcopenshell.file
settings: dict[str, Any]
def execute(self, style: ifcopenshell.entity_instance, attributes: dict[str, Any]) -> None:
self.style = style
@@ -100,7 +99,7 @@ class Usecase:
elif attribute_class == "IfcColourOrFactor":
self.edit_colour_or_factor(key, value)
else:
setattr(self.settings["style"], key, value)
setattr(style, key, value)
def edit_colour_rgb(self, name: str, value: dict[str, Any]):
if (attribute := getattr(self.style, name)) is None:
@@ -50,4 +50,5 @@ def unassign_unit(file: ifcopenshell.file, units: Optional[list[ifcopenshell.ent
units_set = units_set - set(units or [])
if units_set:
unit_assignment.Units = list(units_set)
return
file.remove(unit_assignment)
@@ -23,7 +23,7 @@ import ifcopenshell.api.structural
class TestEditStructuralAnalysisModel(test.bootstrap.IFC4):
def test_editing_a_structural_analysis_model(self):
subject = ifcopenshell.api.structural.add_structural_analysis_model(self.file)
subject = ifcopenshell.api.structural.edit_structural_analysis_model(
ifcopenshell.api.structural.edit_structural_analysis_model(
self.file,
structural_analysis_model=subject,
attributes={"Name": "My edited model", "Description": "Description of my model"},