mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
WIP improved UI ordering, and print export time in console for convenience. See #1222.
This commit is contained in:
@@ -9,38 +9,38 @@ if bpy is not None:
|
|||||||
from . import ui, prop, operator
|
from . import ui, prop, operator
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
"root": None,
|
"project": None,
|
||||||
"aggregate": None,
|
"search": None,
|
||||||
"attribute": None,
|
|
||||||
"bcf": None,
|
"bcf": None,
|
||||||
"clash": None,
|
"root": None,
|
||||||
"classification": None,
|
"unit": None,
|
||||||
"cobie": None,
|
|
||||||
"context": None,
|
|
||||||
"constraint": None,
|
|
||||||
"covetool": None,
|
|
||||||
"csv": None,
|
|
||||||
"diff": None,
|
|
||||||
"bimtester": None,
|
|
||||||
"debug": None,
|
|
||||||
"document": None,
|
|
||||||
"geometry": None,
|
|
||||||
"georeference": None,
|
"georeference": None,
|
||||||
"layer": None,
|
"context": None,
|
||||||
|
"attribute": None,
|
||||||
|
"type": None,
|
||||||
|
"spatial": None,
|
||||||
|
"void": None,
|
||||||
|
"aggregate": None,
|
||||||
|
"geometry": None,
|
||||||
|
"cobie": None,
|
||||||
"material": None,
|
"material": None,
|
||||||
|
"style": None,
|
||||||
|
"layer": None,
|
||||||
"model": None,
|
"model": None,
|
||||||
"owner": None,
|
"owner": None,
|
||||||
"patch": None,
|
|
||||||
"project": None,
|
|
||||||
"pset": None,
|
"pset": None,
|
||||||
"pset_template": None,
|
|
||||||
"qto": None,
|
"qto": None,
|
||||||
"search": None,
|
"classification": None,
|
||||||
"spatial": None,
|
"constraint": None,
|
||||||
"style": None,
|
"document": None,
|
||||||
"type": None,
|
"pset_template": None,
|
||||||
"unit": None,
|
"clash": None,
|
||||||
"void": None,
|
"csv": None,
|
||||||
|
"bimtester": None,
|
||||||
|
"diff": None,
|
||||||
|
"patch": None,
|
||||||
|
"covetool": None,
|
||||||
|
"debug": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
for name in modules.keys():
|
for name in modules.keys():
|
||||||
@@ -62,7 +62,6 @@ if bpy is not None:
|
|||||||
operator.SelectSweptSolidInnerCurves,
|
operator.SelectSweptSolidInnerCurves,
|
||||||
operator.AssignSweptSolidExtrusion,
|
operator.AssignSweptSolidExtrusion,
|
||||||
operator.SelectSweptSolidExtrusion,
|
operator.SelectSweptSolidExtrusion,
|
||||||
operator.FetchLibraryInformation,
|
|
||||||
operator.FetchExternalMaterial,
|
operator.FetchExternalMaterial,
|
||||||
operator.FetchObjectPassport,
|
operator.FetchObjectPassport,
|
||||||
operator.CutSection,
|
operator.CutSection,
|
||||||
@@ -120,7 +119,6 @@ if bpy is not None:
|
|||||||
prop.Sheet,
|
prop.Sheet,
|
||||||
prop.BIMProperties,
|
prop.BIMProperties,
|
||||||
prop.DocProperties,
|
prop.DocProperties,
|
||||||
prop.BIMLibrary,
|
|
||||||
prop.IfcParameter,
|
prop.IfcParameter,
|
||||||
prop.BoundaryCondition,
|
prop.BoundaryCondition,
|
||||||
prop.PsetQto,
|
prop.PsetQto,
|
||||||
@@ -137,7 +135,6 @@ if bpy is not None:
|
|||||||
ui.BIM_PT_drawings,
|
ui.BIM_PT_drawings,
|
||||||
ui.BIM_PT_schedules,
|
ui.BIM_PT_schedules,
|
||||||
ui.BIM_PT_sheets,
|
ui.BIM_PT_sheets,
|
||||||
ui.BIM_PT_library,
|
|
||||||
ui.BIM_PT_camera,
|
ui.BIM_PT_camera,
|
||||||
ui.BIM_PT_text,
|
ui.BIM_PT_text,
|
||||||
ui.BIM_PT_annotation_utilities,
|
ui.BIM_PT_annotation_utilities,
|
||||||
@@ -170,7 +167,6 @@ if bpy is not None:
|
|||||||
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
|
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
|
||||||
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
|
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
|
||||||
bpy.types.Scene.DocProperties = bpy.props.PointerProperty(type=prop.DocProperties)
|
bpy.types.Scene.DocProperties = bpy.props.PointerProperty(type=prop.DocProperties)
|
||||||
bpy.types.Scene.BIMLibrary = bpy.props.PointerProperty(type=prop.BIMLibrary)
|
|
||||||
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
|
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
|
||||||
bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
|
bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
|
||||||
bpy.types.Collection.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties) # Check if we need this
|
bpy.types.Collection.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties) # Check if we need this
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from blenderbim.bim.module.aggregate.data import Data
|
|||||||
class BIM_PT_aggregate(Panel):
|
class BIM_PT_aggregate(Panel):
|
||||||
bl_label = "IFC Aggregates"
|
bl_label = "IFC Aggregates"
|
||||||
bl_idname = "BIM_PT_aggregate"
|
bl_idname = "BIM_PT_aggregate"
|
||||||
|
bl_options = {"DEFAULT_CLOSED"}
|
||||||
bl_space_type = "PROPERTIES"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "WINDOW"
|
bl_region_type = "WINDOW"
|
||||||
bl_context = "object"
|
bl_context = "object"
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ class ExportIFC(bpy.types.Operator):
|
|||||||
settings.logger.info("Starting export")
|
settings.logger.info("Starting export")
|
||||||
ifc_exporter.export()
|
ifc_exporter.export()
|
||||||
settings.logger.info("Export finished in {:.2f} seconds".format(time.time() - start))
|
settings.logger.info("Export finished in {:.2f} seconds".format(time.time() - start))
|
||||||
|
print("Export finished in {:.2f} seconds".format(time.time() - start))
|
||||||
if not bpy.context.scene.DocProperties.ifc_files:
|
if not bpy.context.scene.DocProperties.ifc_files:
|
||||||
new = bpy.context.scene.DocProperties.ifc_files.add()
|
new = bpy.context.scene.DocProperties.ifc_files.add()
|
||||||
new.name = output_file
|
new.name = output_file
|
||||||
@@ -393,15 +394,6 @@ class FetchExternalMaterial(bpy.types.Operator):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
class FetchLibraryInformation(bpy.types.Operator):
|
|
||||||
bl_idname = "bim.fetch_library_information"
|
|
||||||
bl_label = "Fetch Library Information"
|
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
# TODO
|
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class FetchObjectPassport(bpy.types.Operator):
|
class FetchObjectPassport(bpy.types.Operator):
|
||||||
bl_idname = "bim.fetch_object_passport"
|
bl_idname = "bim.fetch_object_passport"
|
||||||
bl_label = "Fetch Object Passport"
|
bl_label = "Fetch Object Passport"
|
||||||
|
|||||||
@@ -474,7 +474,6 @@ class BIMProperties(PropertyGroup):
|
|||||||
data_dir: StringProperty(default=os.path.join(cwd, "data") + os.path.sep, name="Data Directory")
|
data_dir: StringProperty(default=os.path.join(cwd, "data") + os.path.sep, name="Data Directory")
|
||||||
ifc_file: StringProperty(name="IFC File")
|
ifc_file: StringProperty(name="IFC File")
|
||||||
export_schema: EnumProperty(items=[("IFC4", "IFC4", ""), ("IFC2X3", "IFC2X3", "")], name="IFC Schema")
|
export_schema: EnumProperty(items=[("IFC4", "IFC4", ""), ("IFC2X3", "IFC2X3", "")], name="IFC Schema")
|
||||||
has_library: BoolProperty(name="Has Project Library", default=False)
|
|
||||||
contexts: EnumProperty(items=getContexts, name="Contexts")
|
contexts: EnumProperty(items=getContexts, name="Contexts")
|
||||||
available_contexts: EnumProperty(items=[("Model", "Model", ""), ("Plan", "Plan", "")], name="Available Contexts")
|
available_contexts: EnumProperty(items=[("Model", "Model", ""), ("Plan", "Plan", "")], name="Available Contexts")
|
||||||
available_subcontexts: EnumProperty(items=getSubcontexts, name="Available Subcontexts")
|
available_subcontexts: EnumProperty(items=getSubcontexts, name="Available Subcontexts")
|
||||||
@@ -531,15 +530,6 @@ class BIMProperties(PropertyGroup):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class BIMLibrary(PropertyGroup):
|
|
||||||
name: StringProperty(name="Name")
|
|
||||||
version: StringProperty(name="Version")
|
|
||||||
publisher: StringProperty(name="Publisher")
|
|
||||||
version_date: StringProperty(name="Version Date")
|
|
||||||
location: StringProperty(name="Location")
|
|
||||||
description: StringProperty(name="Description")
|
|
||||||
|
|
||||||
|
|
||||||
class IfcParameter(PropertyGroup):
|
class IfcParameter(PropertyGroup):
|
||||||
name: StringProperty(name="Name")
|
name: StringProperty(name="Name")
|
||||||
step_id: IntProperty(name="STEP ID")
|
step_id: IntProperty(name="STEP ID")
|
||||||
|
|||||||
@@ -255,32 +255,6 @@ class BIM_PT_text(Panel):
|
|||||||
row.prop(variable, "prop_key")
|
row.prop(variable, "prop_key")
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_library(Panel):
|
|
||||||
bl_label = "IFC BIM Server Library"
|
|
||||||
bl_idname = "BIM_PT_library"
|
|
||||||
bl_options = {"DEFAULT_CLOSED"}
|
|
||||||
bl_space_type = "PROPERTIES"
|
|
||||||
bl_region_type = "WINDOW"
|
|
||||||
bl_context = "scene"
|
|
||||||
|
|
||||||
def draw(self, context):
|
|
||||||
layout = self.layout
|
|
||||||
layout.use_property_split = True
|
|
||||||
|
|
||||||
scene = context.scene
|
|
||||||
bim_properties = scene.BIMProperties
|
|
||||||
|
|
||||||
layout.row().prop(scene.BIMProperties, "has_library")
|
|
||||||
|
|
||||||
layout.label(text="Project Library:")
|
|
||||||
layout.row().prop(scene.BIMLibrary, "location")
|
|
||||||
layout.row().operator("bim.fetch_library_information")
|
|
||||||
layout.row().prop(scene.BIMLibrary, "name")
|
|
||||||
layout.row().prop(scene.BIMLibrary, "version")
|
|
||||||
layout.row().prop(scene.BIMLibrary, "version_date")
|
|
||||||
layout.row().prop(scene.BIMLibrary, "description")
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_UL_generic(bpy.types.UIList):
|
class BIM_UL_generic(bpy.types.UIList):
|
||||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||||
if item:
|
if item:
|
||||||
|
|||||||
Reference in New Issue
Block a user