IfcOpenShell / IfcOpenShell

Open source IFC library and geometry engine
GNU Lesser General Public License v3.0
1.71k stars 687 forks source link

Using IfcEvent in a process decomposition causes an error #4911

Open fg55b opened 1 week ago

fg55b commented 1 week ago

Greetings!

While testing the visualization of process decomposition on Blender, I faced an error when using IfcEvent as a decomposition part. It occurs when the work schedule containing the IfcEvent instance is opened, breaking the process tree visualization, as shown below.

image

Error returned:

Error: Python: Traceback (most recent call last): File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\bim\ifc.py", line 360, in execute_ifc_operator result = getattr(operator, "_execute")(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\bim\module\sequence\operator.py", line 279, in _execute core.enable_editing_work_schedule_tasks(tool.Sequence, work_schedule=tool.Ifc.get().by_id(self.work_schedule)) File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\core\sequence.py", line 91, in enable_editing_work_schedule_tasks sequence.load_task_properties() File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\tool\sequence.py", line 237, in load_task_properties derived_start = ifcopenshell.util.sequence.derive_date(task, "ScheduleStart", is_earliest=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\sequence.py", line 49, in derive_date current_date = derive_date( ^^^^^^^^^^^^ File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util\sequence.py", line 40, in derive_date if task.TaskTime: ^^^^^^^^^^^^^ File "C:\Users\fge\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 219, in getattr raise AttributeError( AttributeError: entity instance of type 'IFC4X3_RC1.IfcEvent' has no attribute 'TaskTime'

Moult commented 1 week ago

You're correct that the UI is currently tailored towards IfcTask. Can you help attach a sample IFC to help recreate this and check the validity?

fg55b commented 1 week ago

Hi Dion, of course! I'm attaching a very simple file with an IfcEvent on a process decomposition that generates the error.

I checked the validity of the file, it will acuse a normative IFC rule inconsistency (PJS002 - Correct elements related to project) given the declaration of the IfcWorkPlan and IfcTask to the IfcProject, but it seems like a problem with the validation service, I will report this issue in the adequate repository.

tests.zip