This commit is contained in:
Dion Moult
2022-09-03 15:34:52 +10:00
parent e34b737428
commit b9cb1ab012
13 changed files with 38 additions and 18 deletions
+5 -4
View File
@@ -48,9 +48,9 @@ def draw_attribute(attribute, layout, copy_operator=None):
text=attribute.name,
)
if "ScheduleDuration" in attribute.name:
layout.prop(bpy.context.scene.BIMDuration, "duration_days",text="D")
layout.prop(bpy.context.scene.BIMDuration, "duration_hours",text="H")
layout.prop(bpy.context.scene.BIMDuration, "duration_minutes",text="M")
layout.prop(bpy.context.scene.BIMDuration, "duration_days", text="D")
layout.prop(bpy.context.scene.BIMDuration, "duration_hours", text="H")
layout.prop(bpy.context.scene.BIMDuration, "duration_minutes", text="M")
if attribute.is_optional:
layout.prop(attribute, "is_null", icon="RADIOBUT_OFF" if attribute.is_null else "RADIOBUT_ON", text="")
@@ -103,7 +103,8 @@ def import_attribute(attribute, props, data, callback=None):
new.enum_items = json.dumps(ifcopenshell.util.attribute.get_enum_items(attribute))
if data[attribute.name()]:
new.enum_value = data[attribute.name()]
def export_attributes(props, callback=None):
attributes = {}
for prop in props:
-1
View File
@@ -234,7 +234,6 @@ class IfcStore:
data["guid"] = element.GlobalId
IfcStore.commit_link_element(data)
@staticmethod
def relink_all_objects():
if not IfcStore.get_file():
@@ -101,8 +101,9 @@ def update_preview_multiple(self, context):
class BIMModelProperties(PropertyGroup):
ifc_class: bpy.props.EnumProperty(items=get_ifc_class, name="Construction Class", update=update_ifc_class)
ifc_class_browser: bpy.props.EnumProperty(items=get_ifc_class, name="Construction Class",
update=update_ifc_class_browser)
ifc_class_browser: bpy.props.EnumProperty(
items=get_ifc_class, name="Construction Class", update=update_ifc_class_browser
)
relating_type: bpy.props.StringProperty(update=update_relating_type_by_name)
relating_type_id: bpy.props.EnumProperty(
items=get_relating_type, name="Construction Type", update=update_relating_type
@@ -66,10 +66,10 @@ class BimTool(WorkSpaceTool):
if not AuthoringData.is_loaded:
AuthoringData.load()
ifc_classes = AuthoringData.data[
"ifc_classes"] if "ifc_classes" in AuthoringData.data else False
relating_types_ids = AuthoringData.data[
"relating_types_ids"] if "relating_types_ids" in AuthoringData.data else False
ifc_classes = AuthoringData.data["ifc_classes"] if "ifc_classes" in AuthoringData.data else False
relating_types_ids = (
AuthoringData.data["relating_types_ids"] if "relating_types_ids" in AuthoringData.data else False
)
if ifc_classes and relating_types_ids and not props.icon_id:
# hack Dion won't like to show a preview also on the first time the sidebar is shown
@@ -795,7 +795,7 @@ class ToggleLinkVisibility(bpy.types.Operator):
link.is_hidden = layer_collection.exclude
def get_linked_collections(self):
return [
return [
c for c in bpy.data.collections if "IfcProject" in c.name and c.library and c.library.filepath == self.link
]
@@ -159,7 +159,9 @@ class BIMProjectProperties(PropertyGroup):
false_origin: StringProperty(name="False Origin", default="0,0,0")
element_offset: IntProperty(name="Element Offset", default=0)
element_limit: IntProperty(name="Element Offset", default=30000)
should_disable_undo_on_save: BoolProperty(name="Disable Undo When Saving (Faster saves, no undo for you!)", default=False)
should_disable_undo_on_save: BoolProperty(
name="Disable Undo When Saving (Faster saves, no undo for you!)", default=False
)
links: CollectionProperty(name="Links", type=Link)
active_link_index: IntProperty(name="Active Link Index")
export_schema: EnumProperty(items=get_export_schema, name="IFC Schema")
@@ -74,6 +74,7 @@ def get_quantity_types(self, context):
def update_active_resource_index(self, context):
blenderbim.bim.module.pset.data.refresh()
class Resource(PropertyGroup):
name: StringProperty(name="Name", update=updateResourceName)
ifc_definition_id: IntProperty(name="IFC Definition ID")
@@ -548,7 +548,8 @@ class FilterModelElements(Operator):
if obj.BIMObjectProperties.ifc_definition_id in sel_element_ids:
obj.hide_set(True)
#This needs to be moved into ui code, I know ;) - vulevukusej
# This needs to be moved into ui code, I know ;) - vulevukusej
class IfcSelector(Operator):
"""Select elements in model with IFC Selector"""
@@ -567,6 +568,7 @@ class IfcSelector(Operator):
def draw(self, context):
from . import ui
ui.IfcSelectorUI.draw(context, self.layout)
@@ -351,11 +351,13 @@ class BIMWorkScheduleProperties(PropertyGroup):
task_outputs: CollectionProperty(name="Task Outputs", type=TaskProduct)
active_task_output_index: IntProperty(name="Active Task Output Index")
class BIMDuration(PropertyGroup):
duration_days: IntProperty(name="Days ")
duration_hours: IntProperty(name="Hours")
duration_minutes: IntProperty(name="Minutes")
class BIMTaskTreeProperties(PropertyGroup):
# This belongs by itself for performance reasons. https://developer.blender.org/T87737
# In Blender if you add many collection items it makes other property access in the same group really slow.
@@ -733,15 +733,20 @@ class BIM_PT_work_calendars(Panel):
def draw_editable_ui(self):
draw_attributes(self.props.work_calendar_attributes, self.layout)
class BIM_PT_SequenceToolKit(Panel):
bl_label = "Sequence Toolkit"
bl_idname = "BIM_PT_Sequence_toolkit"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Sequence Toolkit"
def draw(self, context):
row = self.layout.row()
row.operator("bim.highlight_product_related_task", text="Go to Input-related Task ", icon="STYLUS_PRESSURE").product_type = "Input"
row.operator(
"bim.highlight_product_related_task", text="Go to Input-related Task ", icon="STYLUS_PRESSURE"
).product_type = "Input"
row = self.layout.row()
row.operator("bim.highlight_product_related_task", text="Go to Output-related Task ",icon="STYLUS_PRESSURE").product_type = "Output"
row.operator(
"bim.highlight_product_related_task", text="Go to Output-related Task ", icon="STYLUS_PRESSURE"
).product_type = "Output"
@@ -110,6 +110,7 @@ def contract_all_tasks(sequence):
sequence.create_task_tree(work_schedule)
sequence.load_task_properties()
def remove_task(ifc, sequence, task=None):
ifc.run("sequence.remove_task", task=task)
work_schedule = sequence.get_active_work_schedule()
+6 -1
View File
@@ -51,7 +51,12 @@ class Obj2Ifc:
[
self.file.createIfcFaceOuterBound(
self.file.createIfcPolyLoop(
[self.file.createIfcCartesianPoint(self.get_coordinates(vertices[index].tolist())) for index in face]
[
self.file.createIfcCartesianPoint(
self.get_coordinates(vertices[index].tolist())
)
for index in face
]
),
True,
)
@@ -53,4 +53,5 @@ class TestEditWorkPlan:
sequence.disable_editing_work_plan().should_be_called()
subject.edit_work_plan(ifc, sequence, work_plan="work_plan")
# TODO continue writing tests