private void dg2_SelectionChanged(object sender, EventArgs e) { if (!isEvent) { return; } GeneralObject go = (GeneralObject)dg2["GenObject", dg2.SelectedRows[0].Index].Value; if (go == null) { return; } //if (go.Image == null) //{ string imagePath = @"\\dsk2.picompany.ru\project\CAD_Settings\Revit_server\13. Settings\02_RoomManager\00_PNG_ПИК1\"; string ExcelDataPath = @"\\dsk2.picompany.ru\project\CAD_Settings\Revit_server\13. Settings\02_RoomManager\БД_Параметрические данные квартир ПИК1.xlsx"; if (isHousesFromLoadedFile) { // Нужно сделать копии румынов во всех секциях go.Houses.ForEach(h => h.Sections.ForEach(s => s.Flats = s.Flats.Select(f => f.Clone()).ToList())); } BeetlyVisualisation.ImageCombiner imgComb = new BeetlyVisualisation.ImageCombiner(go, ExcelDataPath, imagePath, 72); //Serializer ser = new Serializer(); //ser.SerializeList(go, Guid.NewGuid().ToString());//Создание xml go.Image = imgComb.generateGeneralObject(Seria, true); //} pb.Image = go.Image; }
public static void TestCreateImage(HouseInfo house) { GeneralObject go = new GeneralObject(); go.SpotInf = house.SpotInf; //double area = GetTotalArea(house); go.Houses.Add(house); //go.SpotInf.RealArea = area; go.GUID = Guid.NewGuid().ToString(); // ob.Add(go); house.Sections = new List <FlatInfo>(); foreach (var item in house.SectionsBySize) { house.Sections.Add(item.Sections[0]); } string spotName = house.SectionsBySize[0].SpotOwner; string curSteps = string.Join(".", house.Sections.Select(s => s.CountStep.ToString())); if (steps != curSteps) { steps = curSteps; countFile = 0; countSteps++; } countFile++; contFileString = countSteps.ToString("0000") + "_" + countFile.ToString("0000"); string ids = string.Join("_", house.Sections.Select(s => s.IdSection.ToString())); string name = $"{contFileString}_{spotName}_{steps}_{ids}.png"; string imagePath = Path.Combine(testsResultFolder, name); string sourceImgFlats = @"z:\Revit_server\13. Settings\02_RoomManager\00_PNG_ПИК1\"; string ExcelDataPath = Path.Combine(curDir, "БД_Параметрические данные квартир ПИК1 -Не трогать.xlsx"); BeetlyVisualisation.ImageCombiner imgComb = new BeetlyVisualisation.ImageCombiner(go, ExcelDataPath, sourceImgFlats, 72); var img = imgComb.generateGeneralObject(); img.Save(imagePath, ImageFormat.Png); // Лог дома //LogHouse(house, contFileString); }
public void TestCreateImageOneHouse(List <HouseInfo> houses) { GeneralObject go = new GeneralObject(); go.SpotInf = CalcSP(houses); //double area = GetTotalArea(house); //go.SpotInf.RealArea = area; go.GUID = Guid.NewGuid().ToString(); // ob.Add(go); go.Houses = new List <HouseInfo>(); //house.Sections = new List<FlatInfo>(); //foreach (var item in house.SectionsBySize) //{ // house.Sections.Add(item.Sections[0]); //} //go.Houses.Add(house); go.Houses = houses; countFile++; contFileString = countFile.ToString("0000"); var hName = string.Join("_", houses.Select(h => h.Sections[0].SpotOwner + "_" + string.Join(".", h.Sections.Select(s => (s.IsCorner ? "c":"") + s.CountStep.ToString())))); string name = $"{contFileString}_{hName}.png"; string imagePath = Path.Combine(testsResultFolder, name); string sourceImgFlats = @"z:\Revit_server\13. Settings\02_RoomManager\00_PNG_ПИК1\"; string ExcelDataPath = Path.Combine(curDir, "БД_Параметрические данные квартир ПИК1 -Не трогать.xlsx"); BeetlyVisualisation.ImageCombiner imgComb = new BeetlyVisualisation.ImageCombiner(go, ExcelDataPath, sourceImgFlats, 72); var img = imgComb.generateGeneralObject(); img.Save(imagePath, ImageFormat.Png); // Лог дома //LogHouse(house, contFileString); }