mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Create quick project setup button for convenience
This commit is contained in:
@@ -36,6 +36,7 @@ classes = (
|
||||
operator.GenerateGlobalId,
|
||||
operator.AddAttribute,
|
||||
operator.RemoveAttribute,
|
||||
operator.QuickProjectSetup,
|
||||
ui.BIMProperties,
|
||||
ui.Attribute,
|
||||
ui.ObjectProperties,
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user