From cd58b994dd85eb8b4151ad81c277a450bd76cec8 Mon Sep 17 00:00:00 2001 From: Carlos Villagrasa Date: Wed, 27 Jul 2022 08:24:50 +0200 Subject: [PATCH] Renaming AddConstrTypeInstance --- .../blenderbim/bim/module/model/__init__.py | 2 +- src/blenderbim/blenderbim/bim/module/model/data.py | 4 ++-- .../blenderbim/bim/module/model/product.py | 8 ++++---- .../blenderbim/bim/module/model/workspace.py | 2 +- src/blenderbim/blenderbim/bim/module/type/ui.py | 2 +- src/blenderbim/test/bim/feature/geometry.feature | 14 +++++++------- src/blenderbim/test/bim/feature/model.feature | 8 ++++---- src/blenderbim/test/bim/test_feature.py | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/model/__init__.py b/src/blenderbim/blenderbim/bim/module/model/__init__.py index a023470ad3..30c5ff8c12 100644 --- a/src/blenderbim/blenderbim/bim/module/model/__init__.py +++ b/src/blenderbim/blenderbim/bim/module/model/__init__.py @@ -21,7 +21,7 @@ from . import handler, prop, ui, grid, product, wall, slab, stair, opening, pie, classes = ( product.AddEmptyType, - product.AddConstrType, + product.AddConstrTypeInstance, product.DisplayConstrTypes, product.SelectConstructionType, product.HelpConstrTypes, diff --git a/src/blenderbim/blenderbim/bim/module/model/data.py b/src/blenderbim/blenderbim/bim/module/model/data.py index b8d74ecf54..c5ba73182c 100644 --- a/src/blenderbim/blenderbim/bim/module/model/data.py +++ b/src/blenderbim/blenderbim/bim/module/model/data.py @@ -170,13 +170,13 @@ class AuthoringData: @classmethod def new_relating_type(cls, ifc_class=None, relating_type_id=None): if ifc_class is None: - bpy.ops.bim.add_relating_type( + bpy.ops.bim.add_constr_type_instance( ifc_class=cls.props.ifc_class_browser, relating_type_id=int(cls.props.relating_type_id_browser) ) else: cls.props.ifc_class = ifc_class cls.props.relating_type_id = str(relating_type_id) - bpy.ops.bim.add_relating_type() + bpy.ops.bim.add_constr_type_instance() return bpy.context.selected_objects[-1] @staticmethod diff --git a/src/blenderbim/blenderbim/bim/module/model/product.py b/src/blenderbim/blenderbim/bim/module/model/product.py index bc70dd2ebb..312caa0dcf 100644 --- a/src/blenderbim/blenderbim/bim/module/model/product.py +++ b/src/blenderbim/blenderbim/bim/module/model/product.py @@ -57,8 +57,8 @@ def add_empty_type_button(self, context): self.layout.operator(AddEmptyType.bl_idname, icon="FILE_3D") -class AddConstrType(bpy.types.Operator): - bl_idname = "bim.add_relating_type" +class AddConstrTypeInstance(bpy.types.Operator): + bl_idname = "bim.add_constr_type_instance" bl_label = "Add" bl_options = {"REGISTER", "UNDO"} bl_description = "Add Type Instance to the model" @@ -280,7 +280,7 @@ class DisplayConstrTypes(bpy.types.Operator): op.ifc_class = ifc_class_browser op.relating_type_id = relating_type_id_browser col = split.column() - op = col.operator("bim.add_relating_type", icon="ADD") + op = col.operator("bim.add_constr_type_instance", icon="ADD") op.from_invoke = True op.ifc_class = ifc_class_browser if relating_type_id_browser.isnumeric(): @@ -309,7 +309,7 @@ class DisplayConstrTypes(bpy.types.Operator): op = row.operator("bim.select_construction_type", icon="RIGHTARROW_THIN") op.ifc_class = ifc_class_browser op.relating_type_id = relating_type_id_browser - op = row.operator("bim.add_relating_type", icon="ADD") + op = row.operator("bim.add_constr_type_instance", icon="ADD") op.from_invoke = True op.ifc_class = ifc_class_browser if relating_type_id_browser.isnumeric(): diff --git a/src/blenderbim/blenderbim/bim/module/model/workspace.py b/src/blenderbim/blenderbim/bim/module/model/workspace.py index d2f5d939cd..d7be1ebe61 100644 --- a/src/blenderbim/blenderbim/bim/module/model/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/model/workspace.py @@ -184,7 +184,7 @@ class Hotkey(bpy.types.Operator): return {"FINISHED"} def hotkey_S_A(self): - bpy.ops.bim.add_relating_type() + bpy.ops.bim.add_constr_type_instance() def hotkey_S_C(self): if self.has_ifc_class and self.props.ifc_class == "IfcWallType": diff --git a/src/blenderbim/blenderbim/bim/module/type/ui.py b/src/blenderbim/blenderbim/bim/module/type/ui.py index 70e1006096..58cebe2c14 100644 --- a/src/blenderbim/blenderbim/bim/module/type/ui.py +++ b/src/blenderbim/blenderbim/bim/module/type/ui.py @@ -88,4 +88,4 @@ class BIM_PT_type(Panel): def add_object_button(self, context): - self.layout.operator("bim.add_relating_type", icon="PLUGIN") + self.layout.operator("bim.add_constr_type_instance", icon="PLUGIN") diff --git a/src/blenderbim/test/bim/feature/geometry.feature b/src/blenderbim/test/bim/feature/geometry.feature index aa42012036..ee0cdedc39 100644 --- a/src/blenderbim/test/bim/feature/geometry.feature +++ b/src/blenderbim/test/bim/feature/geometry.feature @@ -31,8 +31,8 @@ Scenario: Add representation - add a new representation to a typed instance And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType" And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType" And I press "bim.assign_class" - And I press "bim.add_relating_type" - And I press "bim.add_relating_type" + And I press "bim.add_constr_type_instance" + And I press "bim.add_constr_type_instance" Then the object "IfcWall/Wall" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW" And the object "IfcWall/Wall.001" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW" When the object "IfcWall/Wall" is selected @@ -147,8 +147,8 @@ Scenario: Remove representation - remove an instanced representation from an act And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()" And I set "scene.BIMModelProperties.relating_type_id" to "{cube}" - And I press "bim.add_relating_type" - And I press "bim.add_relating_type" + And I press "bim.add_constr_type_instance" + And I press "bim.add_constr_type_instance" And the object "IfcWallType/Cube" is selected When the variable "representation" is "{ifc}.by_type('IfcWallType')[0].RepresentationMaps[1].MappedRepresentation.id()" And I press "bim.remove_representation(representation_id={representation})" @@ -166,8 +166,8 @@ Scenario: Remove representation - remove an instanced representation from an act And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()" And I set "scene.BIMModelProperties.relating_type_id" to "{cube}" - And I press "bim.add_relating_type" - And I press "bim.add_relating_type" + And I press "bim.add_constr_type_instance" + And I press "bim.add_constr_type_instance" And the object "IfcWall/Wall" is selected When the variable "representation" is "{ifc}.by_type('IfcWall')[0].Representation.Representations[1].id()" And I press "bim.remove_representation(representation_id={representation})" @@ -340,7 +340,7 @@ Scenario: Override duplicate move - copying a type instance with a representatio And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()" And I set "scene.BIMModelProperties.relating_type_id" to "{cube}" - And I press "bim.add_relating_type" + And I press "bim.add_constr_type_instance" And the object "IfcWall/Wall" is selected When I press "object.duplicate_move" Then the object "IfcWall/Wall.001" exists diff --git a/src/blenderbim/test/bim/feature/model.feature b/src/blenderbim/test/bim/feature/model.feature index 7a44a94bd4..cd950f888d 100644 --- a/src/blenderbim/test/bim/feature/model.feature +++ b/src/blenderbim/test/bim/feature/model.feature @@ -11,7 +11,7 @@ Scenario: Add type instance - add from a mesh And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()" And I set "scene.BIMModelProperties.relating_type_id" to "{cube}" - When I press "bim.add_relating_type" + When I press "bim.add_constr_type_instance" Then the object "IfcWall/Wall" exists Scenario: Add type instance - add from an empty @@ -24,7 +24,7 @@ Scenario: Add type instance - add from an empty And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" And the variable "empty" is "{ifc}.by_type('IfcWallType')[0].id()" And I set "scene.BIMModelProperties.relating_type_id" to "{empty}" - When I press "bim.add_relating_type" + When I press "bim.add_constr_type_instance" Then the object "IfcWall/Wall" exists Scenario: Add type instance - add a mesh where existing instances have changed context @@ -37,14 +37,14 @@ Scenario: Add type instance - add a mesh where existing instances have changed c And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType" And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()" And I set "scene.BIMModelProperties.relating_type_id" to "{cube}" - And I press "bim.add_relating_type" + And I press "bim.add_constr_type_instance" And the object "IfcWall/Wall" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW" And the object "IfcWall/Wall" is selected And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.TargetView == 'PLAN_VIEW'][0].id()" And I set "scene.BIMRootProperties.contexts" to "{context}" And I press "bim.add_representation" And the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW" - When I press "bim.add_relating_type" + When I press "bim.add_constr_type_instance" Then the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW" And the object "IfcWall/Wall.001" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW" diff --git a/src/blenderbim/test/bim/test_feature.py b/src/blenderbim/test/bim/test_feature.py index 67382b5f1a..d964e883b9 100644 --- a/src/blenderbim/test/bim/test_feature.py +++ b/src/blenderbim/test/bim/test_feature.py @@ -655,7 +655,7 @@ def i_select_the_active_construction_type(): @when("I add the browser construction type") def i_add_the_active_construction_type(): props = bpy.context.scene.BIMModelProperties - bpy.ops.bim.add_relating_type( + bpy.ops.bim.add_constr_type_instance( ifc_class=props.ifc_class_browser, relating_type_id=int(props.relating_type_id_browser) )