public void Design(string fileName) { //StudTable.FilePath = Server.MapPath(@"~\App_Data\Tables\StudSpacingTable.csv"); //Table502_3_1.FilePath = Server.MapPath(@"~\App_Data\Tables\table502.3.1(1).txt"); fileName = fileName ?? "home-2floor-ft.ifc"; var filePath = Server.MapPath($"~/Users/input-files/{fileName}"); var outputFile = Server.MapPath($"~/Users/output-files/{fileName}-Structure"); IfModel model = IfModel.Open(filePath); //IfStartup.Configuration(model); model.Delete <IfcBeam>(); model.Delete <IfcColumn>(); WoodFrame wf = new WoodFrame(model); // wf.StudTable = IfStartup.LoadTablesAsync.Result; // wf.JoistTable = Table502_3_1.Load(null); // wf.TestAsync(); // model.Delete<IfcWall>(); model.Save(outputFile); // OpenWindow(fileName); }
public void Design(string fileName) { //StudTable.FilePath = Server.MapPath(@"~\App_Data\Tables\StudSpacingTable.csv"); //Table502_3_1.FilePath = Server.MapPath(@"~\App_Data\Tables\table502.3.1(1).txt"); fileName = fileName ?? "home-2floor-ft.ifc"; var filePath = Server.MapPath($"~/Users/input-files/{fileName}"); var outputFile = Server.MapPath($"~/Users/output-files/{fileName}-Structure"); var startup = new IfStartup(); IfModel model = IfModel.Open(filePath); WoodFrame wf = new WoodFrame(model); startup.Configure(model, wf); startup.Configuration(model); //wf.GetPolygons(); //wf.Optimize(); //wf.Write(); model.Save(outputFile); }
static void Main(string[] args) { #region Header "Wall Framing Solutions ".Header(ConsoleColor.Yellow, ConsoleColor.Black); "Starting....".Print(ConsoleColor.Cyan); "".PrintAtPosition(x: 10, foreColor: ConsoleColor.Red); "-------------------------------------------- ".Print(ConsoleColor.White); #endregion var d = Split.Equal(13, .65); string fileName = @"..\..\Models\ITI.Qondos.2.ifc"; string saveName = fileName.Split(new string[] { ".ifc" }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault() + @"-Solved.ifc"; IfcStore ifcStore = IfcStore.Open(fileName); // ifcStore.SaveAs(fileName, Xbim.IO.IfcStorageType.IfcXml); var beams = ifcStore.Instances.OfType <IIfcBeam>(); var prop = new IfProperties((IfcBuildingElement)beams.FirstOrDefault()); var sList = new List <IfSingleValue>() { new IfSingleValue("test value1", "100"), new IfSingleValue("test value2", "400"), new IfSingleValue("test value2", "300"), }; var qList = new List <IfQuantity>() { new IfQuantity("test Quantity value1", "100", IfUnitEnum.AREAUNIT), new IfQuantity("test Quantity value2", "200", IfUnitEnum.AREAUNIT), new IfQuantity("test Quantity value2", "300", IfUnitEnum.AREAUNIT), }; //prop.AddSingleValue("sss value List", sList); //prop.AddQuantities("Quantity value List", qList); //prop.FindByName("Join Status"); //prop.FindByValue("Both joins enabled"); //prop.FindSVProperty(new IfSingleValue("Join Status", "Both joins enabled")); //prop.New(); // ifcStore.SaveAs((fileName + "prop")); using (IfModel model = IfModel.Open(fileName)) { Startup.Configuration(model); model.Save(fileName); model.Delete <IfcBeam>(); model.Delete <IfcColumn>(); WoodFrame wf = new WoodFrame(model); wf.FrameWalls(); model.Delete <IfcWall>(); model.Delete <IfcSlab>(); model.Save(saveName); // OpenWindow(fileName); // OpenWindow(saveName); List <IfWall> walls = model.Instances.OfType <IfWall>().ToList(); List <IfFloor> floors = model.Instances.OfType <IfFloor>().ToList(); $"{walls.Count} walls are found".Print(ConsoleColor.Cyan); $"{floors.Count} floors are found".Print(ConsoleColor.Cyan); List <WallPolygon> wallPolygons = new List <WallPolygon>(); int i = 0; foreach (var item in walls) { $"wall no {i}".Print(ConsoleColor.Cyan); wallPolygons.Add(new WallPolygon(item)); $"{wallPolygons.Last().Regions.Count} regions are found".Print(ConsoleColor.Cyan); $"\t {wallPolygons.Last().Openings.Count} opens".Print(ConsoleColor.Cyan); $"\t {wallPolygons.Last().RLeft.Count} left regions".Print(ConsoleColor.Cyan); $"\t {wallPolygons.Last().RRight.Count} Right regions".Print(ConsoleColor.Cyan); $"\t {wallPolygons.Last().RTop.Count} top regions".Print(ConsoleColor.Cyan); $"\t {wallPolygons.Last().RBottom.Count} bot regions".Print(ConsoleColor.Cyan); $"\t {wallPolygons.Last().RBetween.Count} middle regions".Print(ConsoleColor.Cyan); i++; } GeometryCollection GC1 = new GeometryCollection(); GC1.AddToCollection(model.Instances.OfType <IfJoist>()); GC1.AddToCollection(model.Instances.OfType <IfStud>()); GC1.AddToCollection(model.Instances.OfType <IfSill>()); var coll = GC1.ToExcel(GC1.BOQTable, "Testing Excel", false, "Number", "Collection"); } #region Footer Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Done!"); #endregion Console.ReadLine(); }