Fix bug where aggregates break with filtered elements during import.

This commit is contained in:
Dion Moult
2021-09-12 17:29:11 +10:00
parent 0453db7745
commit 92adeca837
6 changed files with 84 additions and 30 deletions
@@ -61,10 +61,14 @@ class TestLoadProjectElements(test.bim.bootstrap.NewFile):
And the object "IfcBuildingStorey/Level 1" is an "IfcBuildingStorey"
And the object "IfcSlab/Slab" is an "IfcSlab"
And the object "IfcWall/Wall" is an "IfcWall"
And the object "IfcElementAssembly/Empty" is an "IfcElementAssembly"
And the object "IfcBeam/Beam" is an "IfcBeam"
And the object "IfcSite/My Site" is in the collection "IfcSite/My Site"
And the object "IfcBuilding/My Building" is in the collection "IfcBuilding/My Building"
And the object "IfcBuildingStorey/Ground Floor" is in the collection "IfcBuildingStorey/Ground Floor"
And the object "IfcBuildingStorey/Level 1" is in the collection "IfcBuildingStorey/Level 1"
And the object "IfcElementAssembly/Empty" is in the collection "IfcElementAssembly/Empty"
And the object "IfcBeam/Beam" is in the collection "IfcElementAssembly/Empty"
And the object "IfcSlab/Slab" is in the collection "IfcBuildingStorey/Ground Floor"
And the object "IfcWall/Wall" is in the collection "IfcBuildingStorey/Level 1"
And "scene.BIMProjectProperties.is_loading" is "False"
@@ -79,20 +83,24 @@ class TestLoadProjectElements(test.bim.bootstrap.NewFile):
Then "scene.BIMProjectProperties.filter_categories['IfcSite/My Site'].total_elements" is "0"
Then "scene.BIMProjectProperties.filter_categories['IfcBuilding/My Building'].total_elements" is "0"
Then "scene.BIMProjectProperties.filter_categories['IfcBuildingStorey/Ground Floor'].total_elements" is "1"
Then "scene.BIMProjectProperties.filter_categories['IfcBuildingStorey/Level 1'].total_elements" is "1"
When I set "scene.BIMProjectProperties.filter_categories['IfcBuildingStorey/Ground Floor'].is_selected" to "True"
Then "scene.BIMProjectProperties.filter_categories['IfcBuildingStorey/Level 1'].total_elements" is "2"
When I set "scene.BIMProjectProperties.filter_categories['IfcBuildingStorey/Level 1'].is_selected" to "True"
And I press "bim.load_project_elements"
Then the object "IfcProject/My Project" is an "IfcProject"
And the object "IfcSite/My Site" is an "IfcSite"
And the object "IfcBuilding/My Building" is an "IfcBuilding"
And the object "IfcBuildingStorey/Ground Floor" is an "IfcBuildingStorey"
And the object "IfcSlab/Slab" is an "IfcSlab"
And the object "IfcBuildingStorey/Level 1" is an "IfcBuildingStorey"
And the object "IfcWall/Wall" is an "IfcWall"
And the object "IfcElementAssembly/Empty" is an "IfcElementAssembly"
And the object "IfcBeam/Beam" is an "IfcBeam"
And the object "IfcSite/My Site" is in the collection "IfcSite/My Site"
And the object "IfcBuilding/My Building" is in the collection "IfcBuilding/My Building"
And the object "IfcBuildingStorey/Ground Floor" is in the collection "IfcBuildingStorey/Ground Floor"
And the object "IfcSlab/Slab" is in the collection "IfcBuildingStorey/Ground Floor"
And the object "IfcBuildingStorey/Level 1" does not exist
And the object "IfcWall/Wall" does not exist
And the object "IfcBuildingStorey/Level 1" is in the collection "IfcBuildingStorey/Level 1"
And the object "IfcWall/Wall" is in the collection "IfcBuildingStorey/Level 1"
And the object "IfcElementAssembly/Empty" is in the collection "IfcElementAssembly/Empty"
And the object "IfcBeam/Beam" is in the collection "IfcElementAssembly/Empty"
And the object "IfcBuildingStorey/Ground Floor" does not exist
And the object "IfcSlab/Slab" does not exist
"""
@test.bim.bootstrap.scenario
+32 -3
View File
@@ -1,7 +1,7 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1');
FILE_NAME('basic.ifc','2021-09-11T19:44:13+10:00',(),(),'IfcOpenShell 0.6.0b0','BlenderBIM 0.0.999999','Nobody');
FILE_NAME('basic.ifc','2021-09-12T16:48:33+10:00',(),(),'IfcOpenShell 0.6.0b0','BlenderBIM 0.0.999999','Nobody');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
@@ -110,8 +110,8 @@ DATA;
#133=IFCSHAPEREPRESENTATION(#22,'Box','BoundingBox',(#132));
#134=IFCPRODUCTDEFINITIONSHAPE($,$,(#133,#130));
#135=IFCSTYLEDITEM(#129,(#101),'Material');
#136=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1631353443,#9,#8,1631353443);
#137=IFCRELCONTAINEDINSPATIALSTRUCTURE('1CgivZt6z1l8IgKaTkZMcT',#136,$,$,(#116),#71);
#136=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1631429228,#9,#8,1631353443);
#137=IFCRELCONTAINEDINSPATIALSTRUCTURE('1CgivZt6z1l8IgKaTkZMcT',#136,$,$,(#116,#159),#71);
#148=IFCCARTESIANPOINT((0.,0.,3.));
#149=IFCDIRECTION((0.,0.,1.));
#150=IFCDIRECTION((1.,0.,0.));
@@ -122,5 +122,34 @@ DATA;
#155=IFCDIRECTION((1.,0.,0.));
#156=IFCAXIS2PLACEMENT3D(#153,#154,#155);
#157=IFCLOCALPLACEMENT(#152,#156);
#158=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1631429175,#9,#8,1631429175);
#159=IFCELEMENTASSEMBLY('122brjtWrFAPe7NkNdFNlG',#158,'Empty',$,$,#174,$,$,$,.ACCESSORY_ASSEMBLY.);
#170=IFCCARTESIANPOINT((0.,0.,0.));
#171=IFCDIRECTION((0.,0.,1.));
#172=IFCDIRECTION((1.,0.,0.));
#173=IFCAXIS2PLACEMENT3D(#170,#171,#172);
#174=IFCLOCALPLACEMENT(#152,#173);
#175=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1631429290,#9,#8,1631429215);
#176=IFCBEAM('2f_ancUNT1$Btb3bI4H7gM',#175,'Beam',$,$,#216,#194,$,.BEAM.);
#182=IFCINDEXEDPOLYGONALFACE((1,2,4,3));
#183=IFCINDEXEDPOLYGONALFACE((3,4,8,7));
#184=IFCINDEXEDPOLYGONALFACE((7,8,6,5));
#185=IFCINDEXEDPOLYGONALFACE((5,6,2,1));
#186=IFCINDEXEDPOLYGONALFACE((3,7,5,1));
#187=IFCINDEXEDPOLYGONALFACE((8,4,2,6));
#188=IFCCARTESIANPOINTLIST3D(((-1.,-1.,-1.),(-1.,-1.,1.),(-1.,1.,-1.),(-1.,1.,1.),(1.,-1.,-1.),(1.,-1.,1.),(1.,1.,-1.),(1.,1.,1.)));
#189=IFCPOLYGONALFACESET(#188,$,(#182,#183,#184,#185,#186,#187),$);
#190=IFCSHAPEREPRESENTATION(#21,'Body','Tessellation',(#189));
#191=IFCCARTESIANPOINT((-1.,-1.,-1.));
#192=IFCBOUNDINGBOX(#191,2.,2.,2.);
#193=IFCSHAPEREPRESENTATION(#22,'Box','BoundingBox',(#192));
#194=IFCPRODUCTDEFINITIONSHAPE($,$,(#193,#190));
#205=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1631429238,#9,#8,1631429238);
#206=IFCRELAGGREGATES('1SGr7ReC13EhuetdWMr2G9',#205,$,$,#159,(#176));
#212=IFCCARTESIANPOINT((0.,0.,-3.));
#213=IFCDIRECTION((0.,0.,1.));
#214=IFCDIRECTION((1.,0.,0.));
#215=IFCAXIS2PLACEMENT3D(#212,#213,#214);
#216=IFCLOCALPLACEMENT(#174,#215);
ENDSEC;
END-ISO-10303-21;