mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
simplify setup_default_task_columns
This commit is contained in:
@@ -233,7 +233,7 @@ class BIM_PT_work_schedules(Panel):
|
||||
if not self.props.should_show_column_ui:
|
||||
return
|
||||
row = self.layout.row()
|
||||
row.operator("bim.setup_default_task_columns", text="Add Default Columns", icon="ANCHOR_BOTTOM")
|
||||
row.operator("bim.setup_default_task_columns", text="Setup Default Columns", icon="ANCHOR_BOTTOM")
|
||||
row.alignment = "RIGHT"
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(self.props, "column_types", text="")
|
||||
|
||||
@@ -719,26 +719,12 @@ class Sequence(blenderbim.core.tool.Sequence):
|
||||
|
||||
@classmethod
|
||||
def setup_default_task_columns(cls):
|
||||
items = [
|
||||
{
|
||||
"column_type": "IfcTaskTime",
|
||||
"name": "ScheduleStart",
|
||||
},
|
||||
{
|
||||
"column_type": "IfcTaskTime",
|
||||
"name": "ScheduleFinish",
|
||||
},
|
||||
{
|
||||
"column_type": "IfcTaskTime",
|
||||
"name": "ScheduleDuration",
|
||||
},
|
||||
]
|
||||
|
||||
props = bpy.context.scene.BIMWorkScheduleProperties
|
||||
props.columns.clear()
|
||||
for item in items:
|
||||
default_columns = ["ScheduleStart","ScheduleFinish","ScheduleDuration"]
|
||||
for item in default_columns:
|
||||
new = props.columns.add()
|
||||
new.name = f"{item['column_type']}.{item['name']}"
|
||||
new.name = f"IfcTaskTime.{item}"
|
||||
new.data_type = "string"
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user