mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix bugs in 17642ca4e9
This commit is contained in:
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user