mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 02:40:00 +00:00
New function to add ifc opening relationships
This commit is contained in:
@@ -172,6 +172,7 @@ if bpy is not None:
|
|||||||
operator.CalculateEdgeLengths,
|
operator.CalculateEdgeLengths,
|
||||||
operator.CalculateFaceAreas,
|
operator.CalculateFaceAreas,
|
||||||
operator.CalculateObjectVolumes,
|
operator.CalculateObjectVolumes,
|
||||||
|
operator.AddOpening,
|
||||||
prop.StrProperty,
|
prop.StrProperty,
|
||||||
prop.Variable,
|
prop.Variable,
|
||||||
prop.Role,
|
prop.Role,
|
||||||
@@ -216,7 +217,6 @@ if bpy is not None:
|
|||||||
ui.BIM_PT_documentation,
|
ui.BIM_PT_documentation,
|
||||||
ui.BIM_PT_bim,
|
ui.BIM_PT_bim,
|
||||||
ui.BIM_PT_psets,
|
ui.BIM_PT_psets,
|
||||||
ui.BIM_PT_qto,
|
|
||||||
ui.BIM_PT_classifications,
|
ui.BIM_PT_classifications,
|
||||||
ui.BIM_PT_document_information,
|
ui.BIM_PT_document_information,
|
||||||
ui.BIM_PT_constraints,
|
ui.BIM_PT_constraints,
|
||||||
@@ -247,6 +247,8 @@ if bpy is not None:
|
|||||||
ui.BIM_PT_object_structural,
|
ui.BIM_PT_object_structural,
|
||||||
ui.BIM_PT_camera,
|
ui.BIM_PT_camera,
|
||||||
ui.BIM_PT_text,
|
ui.BIM_PT_text,
|
||||||
|
ui.BIM_PT_modeling_utilities,
|
||||||
|
ui.BIM_PT_qto_utilities,
|
||||||
ui.BIM_UL_generic,
|
ui.BIM_UL_generic,
|
||||||
ui.BIM_UL_clash_sets,
|
ui.BIM_UL_clash_sets,
|
||||||
ui.BIM_UL_constraints,
|
ui.BIM_UL_constraints,
|
||||||
@@ -298,6 +300,7 @@ if bpy is not None:
|
|||||||
bpy.types.Camera.BIMCameraProperties = bpy.props.PointerProperty(type=prop.BIMCameraProperties)
|
bpy.types.Camera.BIMCameraProperties = bpy.props.PointerProperty(type=prop.BIMCameraProperties)
|
||||||
bpy.types.TextCurve.BIMTextProperties = bpy.props.PointerProperty(type=prop.BIMTextProperties)
|
bpy.types.TextCurve.BIMTextProperties = bpy.props.PointerProperty(type=prop.BIMTextProperties)
|
||||||
bpy.types.Scene.CoveToolProperties = bpy.props.PointerProperty(type=covetool_prop.CoveToolProperties)
|
bpy.types.Scene.CoveToolProperties = bpy.props.PointerProperty(type=covetool_prop.CoveToolProperties)
|
||||||
|
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
for cls in reversed(classes):
|
for cls in reversed(classes):
|
||||||
@@ -316,3 +319,4 @@ if bpy is not None:
|
|||||||
del(bpy.types.Mesh.BIMMeshProperties)
|
del(bpy.types.Mesh.BIMMeshProperties)
|
||||||
del(bpy.types.Camera.BIMCameraProperties)
|
del(bpy.types.Camera.BIMCameraProperties)
|
||||||
del(bpy.types.Camera.BIMTextProperties)
|
del(bpy.types.Camera.BIMTextProperties)
|
||||||
|
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
|
||||||
|
|||||||
@@ -3394,3 +3394,19 @@ class CalculateObjectVolumes(bpy.types.Operator):
|
|||||||
result += qto_calculator.get_volume(obj)
|
result += qto_calculator.get_volume(obj)
|
||||||
bpy.context.scene.BIMProperties.qto_result = str(round(result, 3))
|
bpy.context.scene.BIMProperties.qto_result = str(round(result, 3))
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
class AddOpening(bpy.types.Operator):
|
||||||
|
bl_idname = 'bim.add_opening'
|
||||||
|
bl_label = 'Add Opening'
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
opening = context.active_object
|
||||||
|
if context.selected_objects[0] != context.active_object:
|
||||||
|
obj = context.selected_objects[0]
|
||||||
|
else:
|
||||||
|
obj = context.selected_objects[1]
|
||||||
|
modifier = obj.modifiers.new('IfcOpeningElement', 'BOOLEAN')
|
||||||
|
modifier.operation = 'DIFFERENCE'
|
||||||
|
modifier.object = opening
|
||||||
|
return {'FINISHED'}
|
||||||
|
|||||||
@@ -1088,8 +1088,8 @@ class BIMProperties(PropertyGroup):
|
|||||||
ifc_patch_output: StringProperty(default='', name='IFC Patch Output IFC')
|
ifc_patch_output: StringProperty(default='', name='IFC Patch Output IFC')
|
||||||
ifc_patch_args: StringProperty(default='', name='Arguments')
|
ifc_patch_args: StringProperty(default='', name='Arguments')
|
||||||
qto_result: StringProperty(default='', name='Qto Result')
|
qto_result: StringProperty(default='', name='Qto Result')
|
||||||
area_unit: StringProperty(default='', name='Area Unit')
|
area_unit: StringProperty(default='', name='IFC Area Unit')
|
||||||
volume_unit: StringProperty(default='', name='Volume Unit')
|
volume_unit: StringProperty(default='', name='IFC Volume Unit')
|
||||||
|
|
||||||
|
|
||||||
class BCFProperties(PropertyGroup):
|
class BCFProperties(PropertyGroup):
|
||||||
|
|||||||
@@ -498,39 +498,6 @@ class BIM_PT_psets(Panel):
|
|||||||
row.operator('bim.remove_property_template', icon='X', text='').index = index
|
row.operator('bim.remove_property_template', icon='X', text='').index = index
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_qto(Panel):
|
|
||||||
bl_label = 'IFC Quantity Take-off'
|
|
||||||
bl_idname = 'BIM_PT_qto'
|
|
||||||
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
|
|
||||||
props = context.scene.BIMProperties
|
|
||||||
|
|
||||||
row = layout.row()
|
|
||||||
layout.label(text="Units:")
|
|
||||||
row = layout.row()
|
|
||||||
row.prop(props, 'area_unit')
|
|
||||||
row = layout.row()
|
|
||||||
row.prop(props, 'volume_unit')
|
|
||||||
|
|
||||||
row = layout.row()
|
|
||||||
layout.label(text="Results:")
|
|
||||||
row = layout.row()
|
|
||||||
row.prop(props, 'qto_result', text='')
|
|
||||||
|
|
||||||
row = layout.row(align=True)
|
|
||||||
row.operator("bim.calculate_edge_lengths")
|
|
||||||
row = layout.row(align=True)
|
|
||||||
row.operator("bim.calculate_face_areas")
|
|
||||||
row = layout.row(align=True)
|
|
||||||
row.operator("bim.calculate_object_volumes")
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_classifications(Panel):
|
class BIM_PT_classifications(Panel):
|
||||||
bl_label = 'IFC Classifications References'
|
bl_label = 'IFC Classifications References'
|
||||||
bl_idname = 'BIM_PT_classifications'
|
bl_idname = 'BIM_PT_classifications'
|
||||||
@@ -1839,3 +1806,53 @@ class BIM_PT_ifcclash(Panel):
|
|||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator('bim.select_ifc_clash_results')
|
row.operator('bim.select_ifc_clash_results')
|
||||||
|
|
||||||
|
|
||||||
|
class BIM_PT_modeling_utilities(Panel):
|
||||||
|
bl_idname = "BIM_PT_modeling_utilities"
|
||||||
|
bl_label = "Architectural"
|
||||||
|
bl_space_type = 'VIEW_3D'
|
||||||
|
bl_region_type = "UI"
|
||||||
|
bl_category = 'BlenderBIM'
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.add_opening")
|
||||||
|
|
||||||
|
|
||||||
|
class BIM_PT_qto_utilities(Panel):
|
||||||
|
bl_idname = "BIM_PT_qto_utilities"
|
||||||
|
bl_label = "Quantity Take-off"
|
||||||
|
bl_space_type = 'VIEW_3D'
|
||||||
|
bl_region_type = "UI"
|
||||||
|
bl_category = 'BlenderBIM'
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
props = context.scene.BIMProperties
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
layout.label(text="Results:")
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'qto_result', text='')
|
||||||
|
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.calculate_edge_lengths")
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.calculate_face_areas")
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.calculate_object_volumes")
|
||||||
|
|
||||||
|
|
||||||
|
def ifc_units(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
props = context.scene.BIMProperties
|
||||||
|
layout = self.layout
|
||||||
|
layout.use_property_decorate = False
|
||||||
|
layout.use_property_split = True
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'area_unit')
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'volume_unit')
|
||||||
|
|||||||
Reference in New Issue
Block a user