mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Display Scheduled Resource Usage as a property within rersource tree
This commit is contained in:
@@ -78,6 +78,7 @@ def update_active_resource_index(self, context):
|
|||||||
class Resource(PropertyGroup):
|
class Resource(PropertyGroup):
|
||||||
name: StringProperty(name="Name", update=updateResourceName)
|
name: StringProperty(name="Name", update=updateResourceName)
|
||||||
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
||||||
|
schedule_usage: FloatProperty(name="Schedule Usage")
|
||||||
has_children: BoolProperty(name="Has Children")
|
has_children: BoolProperty(name="Has Children")
|
||||||
is_expanded: BoolProperty(name="Is Expanded")
|
is_expanded: BoolProperty(name="Is Expanded")
|
||||||
level_index: IntProperty(name="Level Index")
|
level_index: IntProperty(name="Level Index")
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ class BIM_UL_resources(UIList):
|
|||||||
else:
|
else:
|
||||||
row.label(text="", icon="DOT")
|
row.label(text="", icon="DOT")
|
||||||
row.prop(item, "name", emboss=False, text="", icon=icon_map[resource["type"]])
|
row.prop(item, "name", emboss=False, text="", icon=icon_map[resource["type"]])
|
||||||
|
row.prop(item, "schedule_usage", text="", emboss=False)
|
||||||
if context.active_object and not props.active_resource_id:
|
if context.active_object and not props.active_resource_id:
|
||||||
oprops = context.active_object.BIMObjectProperties
|
oprops = context.active_object.BIMObjectProperties
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ class Resource(blenderbim.core.tool.Resource):
|
|||||||
props.is_resource_update_enabled = False
|
props.is_resource_update_enabled = False
|
||||||
for item in tprops.resources:
|
for item in tprops.resources:
|
||||||
resource = tool.Ifc.get().by_id(item.ifc_definition_id)
|
resource = tool.Ifc.get().by_id(item.ifc_definition_id)
|
||||||
item.name = resource.Name if resource else "Unnamed"
|
item.name = resource.Name if resource.Name else "Unnamed"
|
||||||
|
item.schedule_usage = resource.Usage.ScheduleUsage or 1 if resource.Usage else 0
|
||||||
props.is_resource_update_enabled = True
|
props.is_resource_update_enabled = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user