public Window CreateWindow(IfcWindow ifcWall, int floorId) { var dbWindow = _mapper.Map <Window>(ifcWall); dbWindow.FloorId = floorId; dbWindow.SerializedShapeGeometry = JsonConvert.SerializeObject(_ifcGeometryService.GetShape2DGeometryFromMeshTriangles(ifcWall)); return(dbWindow); }
/// <summary> /// Returns the fire rating if defined /// </summary> /// <param name="window"></param> /// <returns></returns> public static IfcLabel?GetFireRating(this IfcWindow window) { IfcValue val = window.GetPropertySingleNominalValue("Pset_WindowCommon", "FireRating "); if (val != null && val is IfcLabel) { return((IfcLabel)val); } else { return(null); } }
/// <summary> /// Returns if the door is external, default is false if not specified /// </summary> /// <param name="window"></param> /// <returns></returns> public static IfcBoolean GetIsExternal(this IfcWindow window) { IfcValue val = window.GetPropertySingleNominalValue("Pset_WindowCommon", "IsExternal"); if (val != null && val is IfcBoolean) { return((IfcBoolean)val); } else { return(new IfcBoolean(false)); //default is to return false } }
/// <summary> /// Returns the Reference ID for this specified type in this project (e.g. type 'A-1'), if known /// </summary> /// <param name="window"></param> /// <returns></returns> public static IfcIdentifier?GetReference(this IfcWindow window) { IfcValue val = window.GetPropertySingleNominalValue("Pset_WindowCommon", "Reference "); if (val != null && val is IfcIdentifier) { return((IfcIdentifier)val); } else { return(null); } }
public void CanDeserializeSmallWallExample() { Entity[] Items = DeserializeAssertISO10303AndExtractItems(Utilities.StepSmallWallExampleString()); Assert.AreEqual(163, Items.Length); Assert.IsNotNull(Items[0]); IfcProject project = Items[0] as IfcProject; Assert.IsNotNull(project); Assert.AreEqual("3MD_HkJ6X2EwpfIbCFm0g_", project.GlobalId); Assert.IsNotNull(Items[123]); IfcWindow window = Items[123] as IfcWindow; Assert.IsNotNull(window); Assert.AreEqual("0LV8Pid0X3IA3jJLVDPidY", window.GlobalId); }