The BIM Tool can now create profiled members.

This commit is contained in:
Dion Moult
2021-07-18 17:20:16 +10:00
parent 9a14406f92
commit a968f2b04d
3 changed files with 12 additions and 5 deletions
@@ -36,9 +36,8 @@ class AddTypeInstance(bpy.types.Operator):
obj = slab.DumbSlabGenerator(self.file.by_id(int(relating_type))).generate()
if obj:
return {"FINISHED"}
elif ifc_class in ["IfcColumnType", "IfcBeamType"]:
elif ifc_class in ["IfcColumnType", "IfcBeamType", "IfcMemberType"]:
obj = profile.DumbProfileGenerator(self.file.by_id(int(relating_type))).generate()
return {"FINISHED"}
if obj:
return {"FINISHED"}
# A cube
@@ -77,7 +76,7 @@ class AddTypeInstance(bpy.types.Operator):
class AlignProduct(bpy.types.Operator):
bl_idname = "bim.align_product"
bl_label = "Align Wall"
bl_label = "Align Product"
bl_options = {"REGISTER", "UNDO"}
align_type: bpy.props.StringProperty()
@@ -113,9 +113,18 @@ class DumbProfileGenerator:
)
elif self.relating_type.is_a("IfcBeamType"):
obj.name = "Beam"
obj.rotation_euler[0] = math.pi / 2
obj.rotation_euler[2] = math.pi / 2
bpy.ops.bim.assign_class(
obj=obj.name, ifc_class="IfcBeam", predefined_type="BEAM", should_add_representation=False
)
elif self.relating_type.is_a("IfcMemberType"):
obj.name = "Member"
obj.rotation_euler[0] = math.pi / 2
obj.rotation_euler[2] = math.pi / 2
bpy.ops.bim.assign_class(
obj=obj.name, ifc_class="IfcMember", predefined_type="MEMBER", should_add_representation=False
)
element = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
bpy.ops.bim.assign_type(relating_type=self.relating_type.id(), related_object=obj.name)
profile_set_usage = ifcopenshell.util.element.get_material(element)