mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 03:37:58 +00:00
Minor refactor
This commit is contained in:
@@ -98,7 +98,7 @@ class IfcExporter:
|
|||||||
obj = bpy.data.objects.get(obj_name)
|
obj = bpy.data.objects.get(obj_name)
|
||||||
if not obj:
|
if not obj:
|
||||||
continue
|
continue
|
||||||
bpy.ops.bim.update_mesh_representation(obj=obj.name)
|
bpy.ops.bim.update_representation(obj=obj.name)
|
||||||
IfcStore.edited_objs.clear()
|
IfcStore.edited_objs.clear()
|
||||||
|
|
||||||
def sync_object_placement(self, obj):
|
def sync_object_placement(self, obj):
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ class AddAnnotation(bpy.types.Operator):
|
|||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
if not obj.BIMObjectProperties.ifc_definition_id:
|
||||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcAnnotation", context_id=subcontext.id())
|
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcAnnotation", context_id=subcontext.id())
|
||||||
else:
|
else:
|
||||||
bpy.ops.bim.update_mesh_representation(obj=obj.name)
|
bpy.ops.bim.update_representation(obj=obj.name)
|
||||||
|
|
||||||
bpy.ops.object.select_all(action="DESELECT")
|
bpy.ops.object.select_all(action="DESELECT")
|
||||||
bpy.context.view_layer.objects.active = obj
|
bpy.context.view_layer.objects.active = obj
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ classes = (
|
|||||||
operator.AddRepresentation,
|
operator.AddRepresentation,
|
||||||
operator.SwitchRepresentation,
|
operator.SwitchRepresentation,
|
||||||
operator.RemoveRepresentation,
|
operator.RemoveRepresentation,
|
||||||
operator.UpdateMeshRepresentation,
|
operator.UpdateRepresentation,
|
||||||
operator.UpdateParametricRepresentation,
|
operator.UpdateParametricRepresentation,
|
||||||
operator.GetRepresentationIfcParameters,
|
operator.GetRepresentationIfcParameters,
|
||||||
prop.BIMGeometryProperties,
|
prop.BIMGeometryProperties,
|
||||||
|
|||||||
@@ -271,9 +271,9 @@ class RemoveRepresentation(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class UpdateMeshRepresentation(bpy.types.Operator):
|
class UpdateRepresentation(bpy.types.Operator):
|
||||||
bl_idname = "bim.update_mesh_representation"
|
bl_idname = "bim.update_representation"
|
||||||
bl_label = "Update Mesh Representation"
|
bl_label = "Update Representation"
|
||||||
obj: bpy.props.StringProperty()
|
obj: bpy.props.StringProperty()
|
||||||
ifc_representation_class: bpy.props.StringProperty()
|
ifc_representation_class: bpy.props.StringProperty()
|
||||||
|
|
||||||
|
|||||||
@@ -78,22 +78,22 @@ class BIM_PT_mesh(Panel):
|
|||||||
op.disable_opening_subtractions = True
|
op.disable_opening_subtractions = True
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.update_mesh_representation")
|
row.operator("bim.update_representation")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
op = row.operator("bim.update_mesh_representation", text="Update Mesh As Rectangle Extrusion")
|
op = row.operator("bim.update_representation", text="Update Mesh As Rectangle Extrusion")
|
||||||
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcRectangleProfileDef"
|
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcRectangleProfileDef"
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
op = row.operator("bim.update_mesh_representation", text="Update Mesh As Circle Extrusion")
|
op = row.operator("bim.update_representation", text="Update Mesh As Circle Extrusion")
|
||||||
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcCircleProfileDef"
|
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcCircleProfileDef"
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
op = row.operator("bim.update_mesh_representation", text="Update Mesh As Arbitrary Extrusion")
|
op = row.operator("bim.update_representation", text="Update Mesh As Arbitrary Extrusion")
|
||||||
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcArbitraryClosedProfileDef"
|
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcArbitraryClosedProfileDef"
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
op = row.operator("bim.update_mesh_representation", text="Update Mesh As Arbitrary Extrusion With Voids")
|
op = row.operator("bim.update_representation", text="Update Mesh As Arbitrary Extrusion With Voids")
|
||||||
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcArbitraryProfileDefWithVoids"
|
op.ifc_representation_class = "IfcExtrudedAreaSolid/IfcArbitraryProfileDefWithVoids"
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|||||||
Reference in New Issue
Block a user