Skip to content

Commit 2727bec

Browse files
committed
Reorder representation_template to improve clarity and organization as per user feedback
1 parent e476944 commit 2727bec

1 file changed

Lines changed: 48 additions & 38 deletions

File tree

  • src/bonsai/bonsai/bim/module/root

src/bonsai/bonsai/bim/module/root/data.py

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -134,44 +134,8 @@ def representation_template(cls):
134134
return [("FACE", "Face", "A planar face surface")]
135135
templates = [
136136
("EMPTY", "No Geometry", "Start with an empty object"),
137-
None,
138-
(
139-
"OBJ",
140-
"Tessellation From Object",
141-
"Use an object as a template to create a new tessellation",
142-
),
143-
(
144-
"MESH",
145-
"Custom Tessellation",
146-
"Create a basic tessellated or faceted cube",
147-
),
148-
(
149-
"EXTRUSION",
150-
"Custom Extruded Solid",
151-
"An extrusion from an arbitrary profile",
152-
),
153137
]
154-
if ifc_class.endswith("Type") or ifc_class.endswith("Style"):
155-
templates.extend(
156-
[
157-
None,
158-
(
159-
"LAYERSET_AXIS2",
160-
"Vertical Layers",
161-
"For objects similar to walls, will automatically add IfcMaterialLayerSet",
162-
),
163-
(
164-
"LAYERSET_AXIS3",
165-
"Horizontal Layers",
166-
"For objects similar to slabs, will automatically add IfcMaterialLayerSet",
167-
),
168-
(
169-
"PROFILESET",
170-
"Extruded Profile",
171-
"Create profile type object, automatically defines IfcMaterialProfileSet with the first profile from library",
172-
),
173-
]
174-
)
138+
175139
if ifc_class in ("IfcWindowType", "IfcWindowStyle", "IfcWindow"):
176140
templates.extend([None, ("WINDOW", "Window", "Parametric window")])
177141
elif ifc_class in ("IfcDoorType", "IfcDoorStyle", "IfcDoor"):
@@ -206,14 +170,60 @@ def representation_template(cls):
206170
"Circular Hollow Distribution Segment",
207171
"Works similarly to Profile, has distribution ports",
208172
),
173+
)
174+
)
175+
if (ifc_class and "IfcCableCarrierSegment" in ifc_class):
176+
templates.extend(
177+
(
209178
(
210179
"FLOW_SEGMENT_U_SHAPE",
211180
"U-Shape Distribution Segment",
212181
"Uses IfcUShapeProfileDef, has distribution ports",
213182
),
214183
)
215184
)
216-
185+
186+
if ifc_class.endswith("Type") or ifc_class.endswith("Style"):
187+
templates.extend(
188+
[
189+
None,
190+
(
191+
"LAYERSET_AXIS2",
192+
"Vertical Layers",
193+
"For objects similar to walls, will automatically add IfcMaterialLayerSet",
194+
),
195+
(
196+
"LAYERSET_AXIS3",
197+
"Horizontal Layers",
198+
"For objects similar to slabs, will automatically add IfcMaterialLayerSet",
199+
),
200+
(
201+
"PROFILESET",
202+
"Extruded Profile",
203+
"Create profile type object, automatically defines IfcMaterialProfileSet with the first profile from library",
204+
),
205+
]
206+
)
207+
templates.extend(
208+
[
209+
None,
210+
(
211+
"OBJ",
212+
"Tessellation From Object",
213+
"Use an object as a template to create a new tessellation",
214+
),
215+
(
216+
"MESH",
217+
"Custom Tessellation",
218+
"Create a basic tessellated or faceted cube",
219+
),
220+
(
221+
"EXTRUSION",
222+
"Custom Extruded Solid",
223+
"An extrusion from an arbitrary profile",
224+
),
225+
]
226+
)
217227
return templates
218228

219229
@classmethod

0 commit comments

Comments
 (0)