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)
@@ -3,7 +3,7 @@ import ifcopenshell
class Usecase:
def __init__(self, foobar: ifcopenshell.entity_instance, version: str = "IFC4", foo: str = None, bar: int = 1, baz: float = 0.5):
def __init__(self, version: str = "IFC4"):
"""Create File
Create a new IFC file object
@@ -15,7 +15,6 @@ class Usecase:
def execute(self) -> ifcopenshell.file:
self.file = ifcopenshell.file(schema=self.settings["version"])
# TODO: add all metadata, pending bug #747
self.file.wrapped_data.header.file_name.name = "/dev/null" # Hehehe
self.file.wrapped_data.header.file_name.time_stamp = (
datetime.datetime.utcnow()