mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 00:49:59 +00:00
Create quick project setup button for convenience
This commit is contained in:
@@ -36,6 +36,7 @@ classes = (
|
|||||||
operator.GenerateGlobalId,
|
operator.GenerateGlobalId,
|
||||||
operator.AddAttribute,
|
operator.AddAttribute,
|
||||||
operator.RemoveAttribute,
|
operator.RemoveAttribute,
|
||||||
|
operator.QuickProjectSetup,
|
||||||
ui.BIMProperties,
|
ui.BIMProperties,
|
||||||
ui.Attribute,
|
ui.Attribute,
|
||||||
ui.ObjectProperties,
|
ui.ObjectProperties,
|
||||||
|
|||||||
@@ -207,6 +207,21 @@ class SelectAudited(bpy.types.Operator):
|
|||||||
object.select_set(True)
|
object.select_set(True)
|
||||||
return {'FINISHED'}
|
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):
|
class AssignPset(bpy.types.Operator):
|
||||||
bl_idname = 'bim.assign_pset'
|
bl_idname = 'bim.assign_pset'
|
||||||
bl_label = 'Assign Pset'
|
bl_label = 'Assign Pset'
|
||||||
|
|||||||
@@ -151,6 +151,9 @@ class BIMPanel(bpy.types.Panel):
|
|||||||
|
|
||||||
layout.label(text="System Setup:")
|
layout.label(text="System Setup:")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.operator('bim.quick_project_setup')
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(bim_properties, "schema_dir")
|
row.prop(bim_properties, "schema_dir")
|
||||||
|
|||||||
Reference in New Issue
Block a user