mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
typing
This commit is contained in:
@@ -80,8 +80,8 @@ def assign_lag_time(
|
||||
# for whatever reason.
|
||||
ifcopenshell.api.sequence.assign_lag_time(model, rel_sequence=sequence, lag_value="P1D")
|
||||
"""
|
||||
lag_value = file.create_entity("IfcDuration", ifcopenshell.util.date.datetime2ifc(lag_value, "IfcDuration"))
|
||||
lag_time = file.create_entity("IfcLagTime", DurationType=duration_type, LagValue=lag_value)
|
||||
duration = file.create_entity("IfcDuration", ifcopenshell.util.date.datetime2ifc(lag_value, "IfcDuration"))
|
||||
lag_time = file.create_entity("IfcLagTime", DurationType=duration_type, LagValue=duration)
|
||||
if rel_sequence.is_a("IfcRelSequence"):
|
||||
if rel_sequence.TimeLag and len(file.get_inverse(rel_sequence.TimeLag)) == 1:
|
||||
file.remove(rel_sequence.TimeLag)
|
||||
|
||||
@@ -25,9 +25,7 @@ def unassign_lag_time(file: ifcopenshell.file, rel_sequence: ifcopenshell.entity
|
||||
The schedule is cascaded afterwards.
|
||||
|
||||
:param rel_sequence: The sequence to remove the lag time from.
|
||||
:type rel_sequence: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
|
||||
@@ -57,12 +55,8 @@ def unassign_lag_time(file: ifcopenshell.file, rel_sequence: ifcopenshell.entity
|
||||
# What if you didn't?
|
||||
ifcopenshell.api.sequence.unassign_lag_time(model, rel_sequence=sequence)
|
||||
"""
|
||||
settings = {
|
||||
"rel_sequence": rel_sequence,
|
||||
}
|
||||
|
||||
if len(file.get_inverse(settings["rel_sequence"].TimeLag)) == 1:
|
||||
file.remove(settings["rel_sequence"].TimeLag)
|
||||
if len(file.get_inverse(rel_sequence.TimeLag)) == 1:
|
||||
file.remove(rel_sequence.TimeLag)
|
||||
else:
|
||||
settings["rel_sequence"].TimeLag = None
|
||||
ifcopenshell.api.sequence.cascade_schedule(file, task=settings["rel_sequence"].RelatedProcess)
|
||||
rel_sequence.TimeLag = None
|
||||
ifcopenshell.api.sequence.cascade_schedule(file, task=rel_sequence.RelatedProcess)
|
||||
|
||||
Reference in New Issue
Block a user