From 3e5a8301604c59988257ca9edd5d112f0436450b Mon Sep 17 00:00:00 2001 From: Han Date: Mon, 17 Apr 2023 23:59:18 +0800 Subject: [PATCH] OptionalIfcLogicalTest for issue #502 --- Tests/OptionalIfcLogicalTest.cs | 34 ++++++++++++ Tests/TestFiles/IfcMaterialLayerTestFile.ifc | 54 ++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 Tests/OptionalIfcLogicalTest.cs create mode 100644 Tests/TestFiles/IfcMaterialLayerTestFile.ifc diff --git a/Tests/OptionalIfcLogicalTest.cs b/Tests/OptionalIfcLogicalTest.cs new file mode 100644 index 000000000..c99ff88bd --- /dev/null +++ b/Tests/OptionalIfcLogicalTest.cs @@ -0,0 +1,34 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xbim.Ifc2x3.MeasureResource; +using Xbim.Ifc4.Interfaces; +using Xbim.IO.Memory; + +namespace Xbim.Essentials.Tests +{ + /// + /// For failing on IfcMaterialLayer.IsVentilated : OPTIONAL IfcLogical + /// + [TestClass] + public class OptionalIfcLogicalTest + { + [TestMethod] + public void IfcMaterialLayerTest() + { + var ifcPath = "TestFiles/IfcMaterialLayerTestFile.ifc"; + using(MemoryModel model = MemoryModel.OpenReadStep21(ifcPath)) + { + var entity = model.Instances[347] as IIfcMaterialLayer; + Assert.IsNotNull(entity); + Assert.IsNotNull(entity.IsVentilated); + Assert.Equals(entity.IsVentilated.ToString(), ".U."); + Assert.Equals(entity.ToString(), + "#347=IFCMATERIALLAYER(#326,417.,.U.,'Component 1',$,$,$);"); + } + } + } +} diff --git a/Tests/TestFiles/IfcMaterialLayerTestFile.ifc b/Tests/TestFiles/IfcMaterialLayerTestFile.ifc new file mode 100644 index 000000000..9841b6082 --- /dev/null +++ b/Tests/TestFiles/IfcMaterialLayerTestFile.ifc @@ -0,0 +1,54 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [Design_Transfer_View]'),'2;1'); +FILE_NAME('./Duplex_A_ifc4.ifc','2019-05-07T17:09:22',('Architect'),('Building Designer Office'),'The EXPRESS Data Manager Version 5.02.0100.09 : 26 Sep 2013','IFC file generated by GRAPHISOFT ARCHICAD-64 22.0.0.','The authorising person'); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#85= IFCDIRECTION((1.,0.,0.)); +#87= IFCDIRECTION((0.,0.,1.)); +#89= IFCCARTESIANPOINT((0.,0.,0.)); +#91= IFCAXIS2PLACEMENT3D(#89,#87,#85); +#92= IFCLOCALPLACEMENT($,#91); +#113= IFCDIRECTION((1.,0.,0.)); +#115= IFCDIRECTION((0.,0.,1.)); +#117= IFCCARTESIANPOINT((0.,0.,0.)); +#119= IFCAXIS2PLACEMENT3D(#117,#115,#113); +#120= IFCLOCALPLACEMENT(#92,#119); +#169= IFCDIRECTION((1.,0.,0.)); +#171= IFCDIRECTION((0.,0.,1.)); +#173= IFCCARTESIANPOINT((0.,0.,-1250.)); +#175= IFCAXIS2PLACEMENT3D(#173,#171,#169); +#176= IFCLOCALPLACEMENT(#120,#175); +#237= IFCDIRECTION((1.,0.,0.)); +#239= IFCDIRECTION((0.,0.,1.)); +#241= IFCCARTESIANPOINT((208.5,-208.5,0.)); +#243= IFCAXIS2PLACEMENT3D(#241,#239,#237); +#244= IFCLOCALPLACEMENT(#176,#243); +#248= IFCCARTESIANPOINT((208.5,-208.5)); +#250= IFCCARTESIANPOINT((8174.5,-208.5)); +#252= IFCCARTESIANPOINT((8591.5,208.5)); +#254= IFCCARTESIANPOINT((-208.5,208.5)); +#256= IFCPOLYLINE((#248,#250,#252,#254,#248)); +#258= IFCARBITRARYCLOSEDPROFILEDEF(.AREA.,'',#256); +#261= IFCDIRECTION((1.,0.,0.)); +#263= IFCDIRECTION((0.,0.,1.)); +#265= IFCCARTESIANPOINT((0.,0.,0.)); +#267= IFCAXIS2PLACEMENT3D(#265,#263,#261); +#268= IFCDIRECTION((0.,0.,1.)); +#270= IFCEXTRUDEDAREASOLID(#258,#267,#268,1250.); +#280= IFCSHAPEREPRESENTATION(#246,'Body','SweptSolid',(#270)); +#287= IFCPRESENTATIONLAYERASSIGNMENT('A-WALL-MBNI.IFC Model',$,(#280,#297),$); +#297= IFCSHAPEREPRESENTATION(#290,'Axis','Curve2D',(#295)); +#291= IFCCARTESIANPOINT((0.,0.)); +#293= IFCCARTESIANPOINT((8383.,0.)); +#295= IFCPOLYLINE((#291,#293)); +#301= IFCPRODUCTDEFINITIONSHAPE($,$,(#280,#297)); +#307= IFCWALLSTANDARDCASE('2O2Fr$t4X7Zf8NOew3FK80',$,'Basic Wall:Foundation - Concrete (417mm):140479',$,'Basic Wall:Foundation - Concrete (417mm):128676',#244,#301,'140479',$); +#326= IFCMATERIAL('Concrete - Cast In Situ',$,$); +#347= IFCMATERIALLAYER(#326,417.,.U.,'Component 1',$,$,$); +#349= IFCMATERIALLAYERSET((#347),'Concrete - Cast In Situ 417',$); +#352= IFCMATERIALLAYERSETUSAGE(#349,.AXIS2.,.POSITIVE.,-208.5,$); +#354 = IFCRELASSOCIATESMATERIAL('3nhziuMrHzR_A3$qPzE8R4',$,$,$,(#307),#352); +ENDSEC; +END-ISO-10303-21;