mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
Users can no longer create orphaned opening elements, which are invalid.
This commit is contained in:
@@ -79,6 +79,11 @@ class IfcClassData:
|
|||||||
names = [d.name() for d in declarations]
|
names = [d.name() for d in declarations]
|
||||||
if ifc_product == "IfcElementType" and tool.Ifc.get_schema() in ("IFC2X3", "IFC4"):
|
if ifc_product == "IfcElementType" and tool.Ifc.get_schema() in ("IFC2X3", "IFC4"):
|
||||||
names.extend(("IfcDoorStyle", "IfcWindowStyle"))
|
names.extend(("IfcDoorStyle", "IfcWindowStyle"))
|
||||||
|
if ifc_product == "IfcElement":
|
||||||
|
names.remove("IfcOpeningElement")
|
||||||
|
if tool.Ifc.get_schema() == "IFC4":
|
||||||
|
# Yeah, weird isn't it.
|
||||||
|
names.remove("IfcOpeningStandardCase")
|
||||||
version = tool.Ifc.get_schema()
|
version = tool.Ifc.get_schema()
|
||||||
return [(c, c, (get_entity_doc(version, c) or {}).get("description", "")) for c in sorted(names)]
|
return [(c, c, (get_entity_doc(version, c) or {}).get("description", "")) for c in sorted(names)]
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ Scenario: Assign material - material layer set
|
|||||||
When I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
When I set "active_object.BIMObjectMaterialProperties.material_type" to "IfcMaterialLayerSet"
|
||||||
And I press "bim.assign_material"
|
And I press "bim.assign_material"
|
||||||
Then the object "IfcWallType/Empty" does not have the material "Default"
|
Then the object "IfcWallType/Empty" does not have the material "Default"
|
||||||
And the object "IfcWallType/Empty" has a "0.1" thick layered material containing the material "Default"
|
And the object "IfcWallType/Empty" has a "100" thick layered material containing the material "Default"
|
||||||
|
|
||||||
Scenario: Unassign material - material layer set
|
Scenario: Unassign material - material layer set
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
@@ -173,9 +173,9 @@ Scenario: Unassign material - material layer set usages will not be removed
|
|||||||
And the object "IfcWall/Cube" is selected
|
And the object "IfcWall/Cube" is selected
|
||||||
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
|
When the variable "type" is "{ifc}.by_type('IfcWallType')[0].id()"
|
||||||
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||||
Then the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
Then the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default"
|
||||||
When I press "bim.unassign_material"
|
When I press "bim.unassign_material"
|
||||||
Then the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
Then the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default"
|
||||||
|
|
||||||
Scenario: Enable editing assigned material - material layer set
|
Scenario: Enable editing assigned material - material layer set
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
@@ -448,4 +448,4 @@ Scenario: Remove material set layer
|
|||||||
And I press "bim.remove_layer(layer={ifc}.by_id({material_set}).MaterialLayers[0].id())"
|
And I press "bim.remove_layer(layer={ifc}.by_id({material_set}).MaterialLayers[0].id())"
|
||||||
And I press "bim.add_layer(layer_set={material_set})"
|
And I press "bim.add_layer(layer_set={material_set})"
|
||||||
When I press "bim.remove_layer(layer={ifc}.by_id({material_set}).MaterialLayers[0].id())"
|
When I press "bim.remove_layer(layer={ifc}.by_id({material_set}).MaterialLayers[0].id())"
|
||||||
Then nothing happens
|
Then nothing happens
|
||||||
|
|||||||
@@ -82,18 +82,6 @@ Scenario: Assign a spatial class to a cube already in a collection
|
|||||||
And the collection "IfcSpace/Cube" is in the collection "IfcBuildingStorey/My Storey"
|
And the collection "IfcSpace/Cube" is in the collection "IfcBuildingStorey/My Storey"
|
||||||
And the object "IfcSpace/Cube" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
|
And the object "IfcSpace/Cube" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
|
||||||
|
|
||||||
Scenario: Assign an opening class to a cube
|
|
||||||
Given an empty IFC project
|
|
||||||
And I add a cube
|
|
||||||
When the object "Cube" is selected
|
|
||||||
And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
|
|
||||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcOpeningElement"
|
|
||||||
And I press "bim.assign_class"
|
|
||||||
Then the object "IfcOpeningElement/Cube" is an "IfcOpeningElement"
|
|
||||||
And the object "IfcOpeningElement/Cube" should display as "WIRE"
|
|
||||||
And the object "IfcOpeningElement/Cube" is in the collection "IfcOpeningElements"
|
|
||||||
And the object "IfcOpeningElement/Cube" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
|
|
||||||
|
|
||||||
Scenario: Assign a class to a cube in a collection
|
Scenario: Assign a class to a cube in a collection
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
And I add a cube
|
And I add a cube
|
||||||
|
|||||||
@@ -87,10 +87,10 @@ Scenario: Assign type - assign to a type with a material layer set, which automa
|
|||||||
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
And I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||||
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
|
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
|
||||||
And the object "IfcWall/Cube" has the material "Default"
|
And the object "IfcWall/Cube" has the material "Default"
|
||||||
And the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
And the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default"
|
||||||
And the object "IfcWall/Cube" dimensions are "2,.1,3"
|
And the object "IfcWall/Cube" dimensions are "2,.1,3"
|
||||||
|
|
||||||
Scenario: Assign type - assign to a dfferent type with a material layer set
|
Scenario: Assign type - assign to a different type with a material layer set
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
And I add a cube
|
And I add a cube
|
||||||
And the object "Cube" is selected
|
And the object "Cube" is selected
|
||||||
@@ -116,16 +116,16 @@ Scenario: Assign type - assign to a dfferent type with a material layer set
|
|||||||
And the variable "layer_set" is "ifcopenshell.util.element.get_material({ifc}.by_id({type2})).id()"
|
And the variable "layer_set" is "ifcopenshell.util.element.get_material({ifc}.by_id({type2})).id()"
|
||||||
And the variable "layer" is "{ifc}.by_id({layer_set}).MaterialLayers[0].id()"
|
And the variable "layer" is "{ifc}.by_id({layer_set}).MaterialLayers[0].id()"
|
||||||
And I press "bim.enable_editing_material_set_item(material_set_item={layer})"
|
And I press "bim.enable_editing_material_set_item(material_set_item={layer})"
|
||||||
And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "0.2"
|
And I set "active_object.BIMObjectMaterialProperties.material_set_item_attributes[0].float_value" to "200"
|
||||||
And I press "bim.edit_material_set_item(material_set_item={layer})"
|
And I press "bim.edit_material_set_item(material_set_item={layer})"
|
||||||
And I press "bim.edit_assigned_material(material_set={layer_set})"
|
And I press "bim.edit_assigned_material(material_set={layer_set})"
|
||||||
When I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
When I press "bim.assign_type(relating_type={type}, related_object='IfcWall/Cube')"
|
||||||
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
|
Then the object "IfcWall/Cube" has a "SweptSolid" representation of "Model/Body/MODEL_VIEW"
|
||||||
And the object "IfcWall/Cube" has the material "Default"
|
And the object "IfcWall/Cube" has the material "Default"
|
||||||
And the object "IfcWall/Cube" has a "0.1" thick layered material containing the material "Default"
|
And the object "IfcWall/Cube" has a "100" thick layered material containing the material "Default"
|
||||||
And the object "IfcWall/Cube" dimensions are "2,.1,3"
|
And the object "IfcWall/Cube" dimensions are "2,.1,3"
|
||||||
When I press "bim.assign_type(relating_type={type2}, related_object='IfcWall/Cube')"
|
When I press "bim.assign_type(relating_type={type2}, related_object='IfcWall/Cube')"
|
||||||
Then the object "IfcWall/Cube" has a "0.2" thick layered material containing the material "Default"
|
Then the object "IfcWall/Cube" has a "200" thick layered material containing the material "Default"
|
||||||
And the object "IfcWall/Cube" dimensions are "2,.2,3"
|
And the object "IfcWall/Cube" dimensions are "2,.2,3"
|
||||||
|
|
||||||
Scenario: Assign type - assign to a type with a material profile set
|
Scenario: Assign type - assign to a type with a material profile set
|
||||||
|
|||||||
@@ -15,34 +15,6 @@ Scenario: Add an opening
|
|||||||
Then the object "Cube" does not exist
|
Then the object "Cube" does not exist
|
||||||
And the object "IfcWall/Cube" is voided by "Cube"
|
And the object "IfcWall/Cube" is voided by "Cube"
|
||||||
|
|
||||||
Scenario: Add an opening on an opening
|
|
||||||
Given an empty IFC project
|
|
||||||
And I add a cube
|
|
||||||
And the object "Cube" is selected
|
|
||||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcOpeningElement"
|
|
||||||
And I press "bim.assign_class"
|
|
||||||
And I add a cube
|
|
||||||
And the object "Cube" is selected
|
|
||||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcOpeningElement"
|
|
||||||
And I press "bim.assign_class"
|
|
||||||
And the object "IfcOpeningElement/Cube" is selected
|
|
||||||
And additionally the object "IfcOpeningElement/Cube.001" is selected
|
|
||||||
When I press "bim.add_opening"
|
|
||||||
Then the object "IfcOpeningElement/Cube" is not a void
|
|
||||||
And the object "IfcOpeningElement/Cube.001" is not a void
|
|
||||||
|
|
||||||
Scenario: Add an opening on a non IFC object
|
|
||||||
Given an empty IFC project
|
|
||||||
And I add a cube
|
|
||||||
And the object "Cube" is selected
|
|
||||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcOpeningElement"
|
|
||||||
And I press "bim.assign_class"
|
|
||||||
And I add a cube
|
|
||||||
And the object "Cube" is selected
|
|
||||||
When I press "bim.add_opening"
|
|
||||||
Then the object "IfcOpeningElement/Cube" is not a void
|
|
||||||
And the object "Cube" is not an IFC element
|
|
||||||
|
|
||||||
Scenario: Add an opening using the BIM tool
|
Scenario: Add an opening using the BIM tool
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
And I add a cube
|
And I add a cube
|
||||||
|
|||||||
Reference in New Issue
Block a user