diff --git a/src/ifcblenderexport/io_export_ifc/__init__.py b/src/ifcblenderexport/io_export_ifc/__init__.py index b7fba5c53c..680446fd6e 100644 --- a/src/ifcblenderexport/io_export_ifc/__init__.py +++ b/src/ifcblenderexport/io_export_ifc/__init__.py @@ -36,6 +36,7 @@ classes = ( operator.GenerateGlobalId, operator.AddAttribute, operator.RemoveAttribute, + operator.QuickProjectSetup, ui.BIMProperties, ui.Attribute, ui.ObjectProperties, diff --git a/src/ifcblenderexport/io_export_ifc/operator.py b/src/ifcblenderexport/io_export_ifc/operator.py index d00b2f0a7f..01f400288d 100644 --- a/src/ifcblenderexport/io_export_ifc/operator.py +++ b/src/ifcblenderexport/io_export_ifc/operator.py @@ -207,6 +207,21 @@ class SelectAudited(bpy.types.Operator): object.select_set(True) return {'FINISHED'} +class QuickProjectSetup(bpy.types.Operator): + bl_idname = 'bim.quick_project_setup' + bl_label = 'Quick Project Setup' + + def execute(self, context): + project = bpy.data.collections.new('IfcProject/My Project') + bpy.context.scene.collection.children.link(project) + site = bpy.data.collections.new('IfcSite/My Site') + project.children.link(site) + building = bpy.data.collections.new('IfcBuilding/My Building') + site.children.link(building) + building_storey = bpy.data.collections.new('IfcBuildingStorey/Ground Floor') + building.children.link(building_storey) + return {'FINISHED'} + class AssignPset(bpy.types.Operator): bl_idname = 'bim.assign_pset' bl_label = 'Assign Pset' diff --git a/src/ifcblenderexport/io_export_ifc/ui.py b/src/ifcblenderexport/io_export_ifc/ui.py index b37e6c3182..f75a226510 100644 --- a/src/ifcblenderexport/io_export_ifc/ui.py +++ b/src/ifcblenderexport/io_export_ifc/ui.py @@ -151,6 +151,9 @@ class BIMPanel(bpy.types.Panel): layout.label(text="System Setup:") + row = layout.row() + row.operator('bim.quick_project_setup') + col = layout.column() row = col.row(align=True) row.prop(bim_properties, "schema_dir")