大量更新
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
using Autodesk.Revit.Attributes;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
@@ -9,14 +13,6 @@ using Newtonsoft.Json;
|
||||
|
||||
using Nice3point.Revit.Toolkit.External;
|
||||
|
||||
using System;
|
||||
|
||||
using System.Data;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
using System.Windows;
|
||||
|
||||
using Szmedi.RvKits.ExportFamilyInfo;
|
||||
|
||||
namespace Szmedi.RvKits.FamilyTools
|
||||
@@ -499,126 +495,5 @@ namespace Szmedi.RvKits.FamilyTools
|
||||
ExportOption(saveDirChoosed, filesFullPathChoosed, famdoc, views, forward);
|
||||
//ExportOption(ps, saveDirChoosed, filesFullPathChoosed, famdoc, views);
|
||||
}
|
||||
//private void TableToExcel(string fullName, DataTable dt, string DirChoosed)
|
||||
//{
|
||||
// IWorkbook workbook;
|
||||
// Configuration config = new Configuration();
|
||||
// //<2F><>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>
|
||||
// string safefilename = Path.GetFileNameWithoutExtension(fullName);
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
||||
// string ExcelWithoutEx = DirChoosed + "\\" + safefilename + "\\" + safefilename + "-" + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
// //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC>
|
||||
// string fileDir = DirChoosed + "\\" + safefilename + "\\";
|
||||
// //<2F><><EFBFBD><EFBFBD>Ŀ¼
|
||||
// DirectoryInfo fileDirInfo = new DirectoryInfo(fileDir);
|
||||
// if (!fileDirInfo.Exists)
|
||||
// {
|
||||
// fileDirInfo.Create();
|
||||
// }
|
||||
// string filename = null;
|
||||
// string ver = config.GetConfig(Selection.ExcelVersion);
|
||||
|
||||
// //if (ver == "Excel <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.xlsx)")
|
||||
// //{
|
||||
|
||||
// // workbook = new XSSFWorkbook();
|
||||
// // filename = ExcelWithoutEx + ".xlsx";
|
||||
|
||||
// //}
|
||||
// if (ver == "Excel 97-2003 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.xls)")
|
||||
// {
|
||||
// workbook = new HSSFWorkbook();
|
||||
// filename = ExcelWithoutEx + ".xls";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// workbook = null;
|
||||
// }
|
||||
// //using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
|
||||
// //{
|
||||
// // //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ݶ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ı<EFBFBD><C4B1>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD>2007<30><37><EFBFBD><EFBFBD>2003<30>湤<EFBFBD><E6B9A4>book
|
||||
// // workbook = WorkbookFactory.Create(fileName);
|
||||
// // fileStream.Close();
|
||||
// //}
|
||||
// if (workbook == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// ISheet sheet = string.IsNullOrEmpty(dt.TableName) ? workbook.CreateSheet("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>") : workbook.CreateSheet(dt.TableName);
|
||||
|
||||
// ICellStyle style = workbook.CreateCellStyle();
|
||||
// //style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// //style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// //style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// //style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
// IFont font = workbook.CreateFont();
|
||||
// font.FontHeightInPoints = 14;
|
||||
// //font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold;
|
||||
// font.FontName = "<22><><EFBFBD><EFBFBD>";
|
||||
// style.SetFont(font);//HEAD <20><>ʽ
|
||||
|
||||
// //<2F><>ͷ
|
||||
// IRow row = sheet.CreateRow(0);
|
||||
// for (int i = 0; i < dt.Columns.Count; i++)
|
||||
// {
|
||||
// //ICellStyle ics = workbook.CreateCellStyle();
|
||||
// //ics.FillPattern = NPOI.SS.UserModel.FillPattern.SolidForeground;
|
||||
// //cell.CellStyle = ics;
|
||||
// ICell cell = row.CreateCell(i);
|
||||
|
||||
// cell.SetCellValue(dt.Columns[i].ColumnName);
|
||||
// }
|
||||
|
||||
// //<2F><><EFBFBD><EFBFBD>
|
||||
// for (int i = 0; i < dt.Rows.Count; i++)
|
||||
// {
|
||||
// IRow row1 = sheet.CreateRow(i + 1);
|
||||
// for (int j = 0; j < dt.Columns.Count; j++)
|
||||
// {
|
||||
|
||||
// ICell cell = row1.CreateCell(j);
|
||||
// if (dt.Rows[i][0].ToString() == "")
|
||||
// {
|
||||
// cell.CellStyle = style;
|
||||
// //IFont f = workbook.CreateFont();
|
||||
// //f.FontHeightInPoints = 14;
|
||||
// //cell.CellStyle.SetFont(f);
|
||||
// }
|
||||
// cell.SetCellValue(dt.Rows[i][j].ToString());
|
||||
// }
|
||||
// }
|
||||
|
||||
// //תΪ<D7AA>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// MemoryStream stream = new MemoryStream();
|
||||
// workbook.Write(stream);
|
||||
// var buf = stream.ToArray();
|
||||
// FileInfo file = new FileInfo(filename);
|
||||
// //<2F><><EFBFBD><EFBFBD>ΪExcel<65>ļ<EFBFBD>
|
||||
// using (FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.Write))
|
||||
// {
|
||||
|
||||
// fs.Write(buf, 0, buf.Length);
|
||||
// fs.Flush();
|
||||
// }
|
||||
//}
|
||||
|
||||
//foreach (Autodesk.Revit.DB.View view in views)
|
||||
//{
|
||||
// //if (view.IsTemplate) continue;
|
||||
// if (view.ViewType == ViewType.ThreeD)
|
||||
// {
|
||||
// Transaction trans = new Transaction(famdoc, "Export Image");
|
||||
// trans.Start();
|
||||
// if (concol!=null)
|
||||
// {
|
||||
// famdoc.Delete(concol.ToElementIds());
|
||||
// }
|
||||
// var graphicDisplayOptions = view.get_Parameter(BuiltInParameter.MODEL_GRAPHICS_STYLE);
|
||||
// graphicDisplayOptions.Set(6);
|
||||
// trans.Commit();
|
||||
// ImageExportList.Add(view.Id);
|
||||
// }
|
||||
//}
|
||||
//string directroy = Path.GetDirectoryName(path) +"\\"+;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user