mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 23:40:59 +00:00
Fix bug where we now accommodate invalid durations in the scheduling tree
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
import isodate
|
||||||
import ifcopenshell.api
|
import ifcopenshell.api
|
||||||
import ifcopenshell.util.attribute
|
import ifcopenshell.util.attribute
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
@@ -184,6 +185,16 @@ def updateTaskDuration(self, context):
|
|||||||
props = context.scene.BIMWorkScheduleProperties
|
props = context.scene.BIMWorkScheduleProperties
|
||||||
if not props.is_task_update_enabled:
|
if not props.is_task_update_enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.duration == "-":
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
isodate.parse_duration(self.duration),
|
||||||
|
except:
|
||||||
|
self.duration = "-"
|
||||||
|
return
|
||||||
|
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
task = self.file.by_id(self.ifc_definition_id)
|
task = self.file.by_id(self.ifc_definition_id)
|
||||||
if task.TaskTime:
|
if task.TaskTime:
|
||||||
|
|||||||
Reference in New Issue
Block a user