mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Minor fix.
This commit is contained in:
@@ -71,7 +71,8 @@ class ObjectPsetsData(Data):
|
|||||||
if element.is_a("IfcTypeObject"):
|
if element.is_a("IfcTypeObject"):
|
||||||
return
|
return
|
||||||
element_type = ifcopenshell.util.element.get_type(element)
|
element_type = ifcopenshell.util.element.get_type(element)
|
||||||
return cls.psetqtos(element_type)
|
if element_type:
|
||||||
|
return cls.psetqtos(element_type)
|
||||||
|
|
||||||
|
|
||||||
class ObjectQtosData(Data):
|
class ObjectQtosData(Data):
|
||||||
|
|||||||
@@ -656,13 +656,13 @@ class CopyTaskAttribute(bpy.types.Operator):
|
|||||||
bl_idname = "bim.copy_task_attribute"
|
bl_idname = "bim.copy_task_attribute"
|
||||||
bl_label = "Copy Task Attribute"
|
bl_label = "Copy Task Attribute"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
data: bpy.props.StringProperty()
|
name: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
return IfcStore.execute_ifc_operator(self, context)
|
return IfcStore.execute_ifc_operator(self, context)
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
data = json.loads(self.data)
|
value = context.scene.BIMWorkScheduleProperties.task_attributes.get(self.name).get_value()
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
props = context.scene.BIMTaskTreeProperties
|
props = context.scene.BIMTaskTreeProperties
|
||||||
for task in props.tasks:
|
for task in props.tasks:
|
||||||
@@ -670,10 +670,8 @@ class CopyTaskAttribute(bpy.types.Operator):
|
|||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"sequence.edit_task",
|
"sequence.edit_task",
|
||||||
self.file,
|
self.file,
|
||||||
**{
|
task=self.file.by_id(task.ifc_definition_id),
|
||||||
"task": self.file.by_id(task.ifc_definition_id),
|
attributes={self.name: value},
|
||||||
"attributes": {data["name"]: None if data["is_null"] else data["value"]},
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
Data.load(IfcStore.get_file())
|
Data.load(IfcStore.get_file())
|
||||||
bpy.ops.bim.load_task_properties()
|
bpy.ops.bim.load_task_properties()
|
||||||
|
|||||||
@@ -1,6 +1,34 @@
|
|||||||
@sequence
|
@sequence
|
||||||
Feature: Sequence
|
Feature: Sequence
|
||||||
Covers Visualising Work Schedule Date Range.
|
|
||||||
|
Scenario: Add work plan
|
||||||
|
Given an empty IFC project
|
||||||
|
When I press "bim.add_work_plan"
|
||||||
|
Then nothing happens
|
||||||
|
|
||||||
|
Scenario: Enable editing task
|
||||||
|
Given an empty IFC project
|
||||||
|
And I press "bim.add_work_schedule"
|
||||||
|
And the variable "work_schedule" is "IfcStore.get_file().by_type('IfcWorkSchedule')[0].id()"
|
||||||
|
And I press "bim.enable_editing_tasks(work_schedule={work_schedule})"
|
||||||
|
And I press "bim.add_summary_task(work_schedule={work_schedule})"
|
||||||
|
And the variable "task" is "IfcStore.get_file().by_type('IfcTask')[0].id()"
|
||||||
|
When I press "bim.enable_editing_task(task={task})"
|
||||||
|
Then nothing happens
|
||||||
|
|
||||||
|
Scenario: Copy task attribute
|
||||||
|
Given an empty IFC project
|
||||||
|
And I press "bim.add_work_schedule"
|
||||||
|
And the variable "work_schedule" is "IfcStore.get_file().by_type('IfcWorkSchedule')[0].id()"
|
||||||
|
And I press "bim.enable_editing_tasks(work_schedule={work_schedule})"
|
||||||
|
And I press "bim.add_summary_task(work_schedule={work_schedule})"
|
||||||
|
And I press "bim.add_summary_task(work_schedule={work_schedule})"
|
||||||
|
And the variable "task" is "IfcStore.get_file().by_type('IfcTask')[0].id()"
|
||||||
|
And I press "bim.enable_editing_task(task={task})"
|
||||||
|
And I set "scene.BIMWorkScheduleProperties.task_attributes[2].string_value" to "Foo"
|
||||||
|
When I set "scene.BIMTaskTreeProperties.tasks[1].is_selected" to "True"
|
||||||
|
And I press "bim.copy_task_attribute(name='Description')"
|
||||||
|
Then nothing happens
|
||||||
|
|
||||||
Scenario: See the current frame date as text
|
Scenario: See the current frame date as text
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ class Usecase:
|
|||||||
name=self.settings["name"],
|
name=self.settings["name"],
|
||||||
)
|
)
|
||||||
work_plan.CreationDate = ifcopenshell.util.date.datetime2ifc(datetime.now(), "IfcDateTime")
|
work_plan.CreationDate = ifcopenshell.util.date.datetime2ifc(datetime.now(), "IfcDateTime")
|
||||||
person = ifcopenshell.api.owner.settings.get_person(self.file)
|
user = ifcopenshell.api.owner.settings.get_user(self.file)
|
||||||
if person:
|
if user:
|
||||||
work_plan.Creators = [person]
|
work_plan.Creators = [user.ThePerson]
|
||||||
work_plan.StartTime = ifcopenshell.util.date.datetime2ifc(self.settings["start_time"], "IfcDateTime")
|
work_plan.StartTime = ifcopenshell.util.date.datetime2ifc(self.settings["start_time"], "IfcDateTime")
|
||||||
|
|
||||||
context = self.file.by_type("IfcContext")[0]
|
context = self.file.by_type("IfcContext")[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user