-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.py
182 lines (144 loc) · 5.79 KB
/
ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import bpy
from bpy.types import Panel
from . import prop, operator
class GENERAL_panel:
bl_label = "BlenderBIM Spreadsheet"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "BlenderBIM | Spreadsheet"
bl_options = {"DEFAULT_CLOSED"}
class GENERAL_PT_PANEL(GENERAL_panel, Panel):
bl_idname = "EXAMPLE_PT_panel_1"
bl_label = "BlenderBIM | Spreadsheet"
def draw(self, context):
layout = self.layout
class GENERAL_IFC_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "General"
def draw(self, context):
ifc_properties = context.scene.ifc_properties
layout = self.layout
box = layout.box()
row = box.row()
row.prop(ifc_properties, "my_ifcbuildingstorey")
box.prop(ifc_properties, "my_ifcproduct")
row = box.row()
row.prop(ifc_properties, "my_ifcproductname")
row = box.row()
row.prop(ifc_properties, "my_ifcproducttypename")
row = box.row()
row.prop(ifc_properties, "my_ifcclassification")
row = box.row()
row.prop(ifc_properties, "my_ifcmaterial" )
class COMMON_PROPERTIES_IFC_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "Common Properties"
def draw(self, context):
ifc_properties = context.scene.ifc_properties
layout = self.layout
box = layout.box()
row = box.row()
row.prop(ifc_properties, "my_property_IsExternal")
row = box.row()
row.prop(ifc_properties, "my_property_LoadBearing")
row = box.row()
row.prop(ifc_properties, "my_property_FireRating")
row = box.row()
row.prop(ifc_properties, "my_property_AcousticRating")
class CUSTOM_PROPERTIES_IFC_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "Custom Properties"
def draw(self, context):
layout = self.layout
box = layout.box()
box.operator("custom.collection_actions", text="Add", icon="ADD").action = "add"
custom_collection = context.scene.custom_collection
row = layout.row(align=True)
if len(custom_collection.items) > 0:
row.operator("clear.clear_properties", text="Clear Properties")
for i, item in enumerate(custom_collection.items):
row = box.row(align=True)
row.prop(item, "name")
op = row.operator("custom.collection_actions", text="", icon="REMOVE")
op.action = "remove"
op.index = i
class SPREADSHEET_IFC_FILE_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "Spreadsheet"
def draw(self, context):
ifc_properties = context.scene.ifc_properties
layout = self.layout
box_spreadsheet = layout.box()
row = box_spreadsheet.row()
row.prop(ifc_properties, "my_spreadsheetfile")
row = box_spreadsheet.row()
row.prop(ifc_properties, "ods_or_xlsx")
box_spreadsheet.operator("export.tospreadsheet",icon="SPREADSHEET")
class FILTER_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "Filter IFC elements"
def draw(self, context):
layout = self.layout
self.layout.operator("object.filter_ifc_elements", text="Filter IFC elements", icon="FILTER")
self.layout.operator("object.unhide_all", text="Unhide IFC elements", icon="LIGHT")
class BASE_QUANTITIES_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "BaseQuantities"
def draw(self, context):
ifc_properties = context.scene.ifc_properties
layout = self.layout
box = layout.box()
row = box.row()
row.prop(ifc_properties, "my_quantity_Length")
row = box.row()
row.prop(ifc_properties, "my_quantity_Width")
row = box.row()
row.prop(ifc_properties, "my_quantity_Height")
row = box.row()
row.prop(ifc_properties, "my_quantity_GrossFootprintArea")
row = box.row()
row.prop(ifc_properties, "my_quantity_NetFootprintArea")
row = box.row()
row.prop(ifc_properties, "my_quantity_Area")
row = box.row()
row.prop(ifc_properties, "my_quantity_NetArea")
row = box.row()
row.prop(ifc_properties, "my_quantity_NetSideArea")
row = box.row()
row.prop(ifc_properties, "my_quantity_GrossSideArea")
row = box.row()
row.prop(ifc_properties, "my_quantity_GrossArea")
row = box.row()
row.prop(ifc_properties, "my_quantity_Volume")
row = box.row()
row.prop(ifc_properties, "my_quantity_NetVolume")
row = box.row()
row.prop(ifc_properties, "my_quantity_GrossVolume")
class SAVE_SELECTION_PT_PANEL(GENERAL_panel, Panel):
bl_parent_id = "EXAMPLE_PT_panel_1"
bl_label = "Save Selection"
def draw(self, context):
ifc_properties = context.scene.ifc_properties
layout = self.layout
box = layout.box()
row = box.row()
row.prop(ifc_properties, "my_selectionload")
row.operator("save.confirm_selection", text="",icon="PLAY")
box.operator("save.save_and_load_selection",text="Save Selection Set")
box.operator("save.clear_selection",text="Clear All")
classes = (
GENERAL_PT_PANEL,
GENERAL_IFC_PT_PANEL,
COMMON_PROPERTIES_IFC_PT_PANEL,
BASE_QUANTITIES_PT_PANEL,
CUSTOM_PROPERTIES_IFC_PT_PANEL,
SAVE_SELECTION_PT_PANEL,
SPREADSHEET_IFC_FILE_PT_PANEL,
FILTER_PT_PANEL,
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)