diff --git a/uBIMEarthTools/Properties/AssemblyInfo.cs b/uBIMEarthTools/Properties/AssemblyInfo.cs deleted file mode 100644 index b54471a..0000000 --- a/uBIMEarthTools/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 有关程序集的一般信息由以下 -// 控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("地质建模")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("地质建模")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -//将 ComVisible 设置为 false 将使此程序集中的类型 -//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -//请将此类型的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("85a8fb17-cf6e-4d07-ad0d-f860c37b08f5")] - -// 程序集的版本信息由下列四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: : -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/uBIMEarthTools/Utils/ExcelHelper-Zhuangkh.cs b/uBIMEarthTools/Utils/ExcelHelper-Zhuangkh.cs deleted file mode 100644 index dbfaa88..0000000 --- a/uBIMEarthTools/Utils/ExcelHelper-Zhuangkh.cs +++ /dev/null @@ -1,121 +0,0 @@ -using Autodesk.Revit.DB; -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace uBIM_EarthTools -{ - class ExcelHelper - { - /// - /// 读取地质数据 - /// 原数据单位为M,转换为MM - /// - /// 文件路径 - /// - public static List GetDataFromExcel(string filePath) - { - List boreholeList = new List(); - Microsoft.Office.Interop.Excel.Workbook wb = null; - Microsoft.Office.Interop.Excel.Worksheet ws = null; - object missing = System.Reflection.Missing.Value; - Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();//lauch excel application - excel.DisplayAlerts = false; - if (excel != null) - { - excel.Visible = false; - excel.UserControl = true;// 以只读的形式打开EXCEL文件 - wb = excel.Workbooks.Open(filePath, missing, true, missing, missing, missing, - missing, missing, missing, true, missing, missing, missing, missing, missing); - - ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.Item[1]; - Dictionary typeList = new Dictionary(); - for (int i = 1; i < ws.UsedRange.Rows.Count + 1; i++) - { - typeList.Add(ws.Cells[i, 1].Text, ws.Cells[i, 2].Text); - } - - - - ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.Item[2]; - //取得总记录行数(包括标题列) - int rowsint = ws.UsedRange.Rows.Count; //得到行数 - //int rowsint = begin_row + 2*10; - int columnsint = ws.UsedRange.Columns.Count;//得到列数 - for (int i = 1; i <= rowsint; i += 2) - { - Borehole borehole = new Borehole(); - borehole.Name = ws.Cells[i, 1].Text; - double x = double.Parse(ws.Cells[i, 2].Text) * 1000 / 304.8; - double y = double.Parse(ws.Cells[i, 3].Text) * 1000 / 304.8; - for (int j = 4; j <= columnsint; j++) - { - if (null == ws.Cells[i + 1, j].Text || ws.Cells[i + 1, j].Text == "") - break; - else - { - string type = string.Empty; - try - { - type = "地质" + ws.Cells[i, j].Text + "-" + typeList[ws.Cells[i, j].Text] + "层"; - - } - catch (Exception e) - { - MessageBox.Show(i.ToString() + "," + j.ToString()); - throw; - } - double z = double.Parse(ws.Cells[i+1, j].Text) * 1000 / 304.8; - XYZ xyz = new XYZ(x, y, z); - GeologyLayer geologyLayer = new GeologyLayer(type, xyz); - borehole.ValueList.Add(geologyLayer); - } - } - boreholeList.Add(borehole); - } - } - KillProcess(excel); - return boreholeList; - } - public static List GetGeologyType(string filePath) - { - List types = new List(); - Microsoft.Office.Interop.Excel.Workbook wb = null; - Microsoft.Office.Interop.Excel.Worksheet ws = null; - object missing = System.Reflection.Missing.Value; - Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();//lauch excel application - excel.DisplayAlerts = false; - if (excel != null) - { - excel.Visible = false; - excel.UserControl = true;// 以只读的形式打开EXCEL文件 - wb = excel.Workbooks.Open(filePath, missing, true, missing, missing, missing, - missing, missing, missing, true, missing, missing, missing, missing, missing); - - ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.get_Item(1); - for (int i = 1; i < ws.UsedRange.Rows.Count + 1; i++) - { - types.Add("地质" + ws.Cells[i, 1].Text + "-" + ws.Cells[i, 2].Text + "层"); - } - } - KillProcess(excel); - return types; - } - - - - #region 结束excel进程 - [DllImport("User32.dll", CharSet = CharSet.Auto)] - private static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID); - private static void KillProcess(Microsoft.Office.Interop.Excel.Application excel) - { - IntPtr t = new IntPtr(excel.Hwnd); - int k = 0; - GetWindowThreadProcessId(t, out k); - System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(k); - p.Kill(); - } - #endregion - } -} diff --git a/uBIMEarthTools/Utils/ExcelHelper.cs b/uBIMEarthTools/Utils/ExcelHelper.cs index 9757098..09013de 100644 --- a/uBIMEarthTools/Utils/ExcelHelper.cs +++ b/uBIMEarthTools/Utils/ExcelHelper.cs @@ -18,77 +18,6 @@ namespace uBIMEarthTools.Utils { class ExcelHelper { - /// - /// 读取地质数据 - /// 原数据单位为M,转换为MM - /// - /// 文件路径 - /// - public static List GetDataFromXls(string filePath) - { - List boreholeList = new List(); - Microsoft.Office.Interop.Excel.Workbook wb = null; - Microsoft.Office.Interop.Excel.Worksheet ws = null; - object missing = System.Reflection.Missing.Value; - Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();//lauch excel application - excel.DisplayAlerts = false; - if (excel != null) - { - excel.Visible = false; - excel.UserControl = true;// 以只读的形式打开EXCEL文件 - wb = excel.Workbooks.Open(filePath, missing, true, missing, missing, missing, - missing, missing, missing, true, missing, missing, missing, missing, missing); - - ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.Item[1]; - Dictionary typeList = new Dictionary(); - for (int i = 1; i < ws.UsedRange.Rows.Count + 1; i++) - { - typeList.Add(ws.Cells[i, 1].Text, ws.Cells[i, 2].Text); - } - - - - ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.Item[2]; - //取得总记录行数(包括标题列) - int rowsint = ws.UsedRange.Rows.Count; //得到行数 - //int rowsint = begin_row + 2*10; - int columnsint = ws.UsedRange.Columns.Count;//得到列数 - for (int i = 1; i <= rowsint; i += 2) - { - Borehole borehole = new Borehole(); - borehole.Name = ws.Cells[i, 1].Text; - double x = double.Parse(ws.Cells[i, 2].Text) * 1000 / 304.8; - double y = double.Parse(ws.Cells[i, 3].Text) * 1000 / 304.8; - for (int j = 4; j <= columnsint; j++) - { - if (null == ws.Cells[i + 1, j].Text || ws.Cells[i + 1, j].Text == "") - break; - else - { - string type = string.Empty; - try - { - type = "地质" + ws.Cells[i, j].Text + "-" + typeList[ws.Cells[i, j].Text] + "层"; - - } - catch (Exception e) - { - MessageBox.Show(i.ToString() + "," + j.ToString()); - throw; - } - double z = double.Parse(ws.Cells[i + 1, j].Text) * 1000 / 304.8; - XYZ xyz = new XYZ(x, y, z); - GeologyLayer geologyLayer = new GeologyLayer(type, xyz); - borehole.ValueList.Add(geologyLayer); - } - } - boreholeList.Add(borehole); - } - } - KillProcess(excel); - return boreholeList; - } - public static List GetDataFromExcel(string filePath) { ExcelPackage.LicenseContext = LicenseContext.NonCommercial; @@ -175,19 +104,6 @@ namespace uBIMEarthTools.Utils return typeList; } - #region 结束excel进程 - [DllImport("User32.dll", CharSet = CharSet.Auto)] - private static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID); - private static void KillProcess(Microsoft.Office.Interop.Excel.Application excel) - { - IntPtr t = new IntPtr(excel.Hwnd); - int k = 0; - GetWindowThreadProcessId(t, out k); - System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(k); - p.Kill(); - } - #endregion - #region 根据Excel和Sheet返回DataTable /// diff --git a/uBIMEarthTools/packages.config b/uBIMEarthTools/packages.config deleted file mode 100644 index ebb4de3..0000000 --- a/uBIMEarthTools/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/uBIMEarthTools/uBIMEarthTools.csproj b/uBIMEarthTools/uBIMEarthTools.csproj index 8bc25f8..396edec 100644 --- a/uBIMEarthTools/uBIMEarthTools.csproj +++ b/uBIMEarthTools/uBIMEarthTools.csproj @@ -1,203 +1,19 @@ - - - + - Debug - AnyCPU - {85A8FB17-CF6E-4D07-AD0D-F860C37B08F5} - Library - Properties - uBIMEarthTools - uBIMEarthTools - v4.8 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x64 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net472 + true + true - - ..\packages\EPPlus.5.6.4\lib\net45\EPPlus.dll - - - ..\packages\SharpZipLib.1.0.0\lib\net45\ICSharpCode.SharpZipLib.dll - - - ..\packages\Microsoft.IO.RecyclableMemoryStream.1.4.1\lib\net46\Microsoft.IO.RecyclableMemoryStream.dll - - - False - True - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll - - - ..\packages\NPOI.2.4.1\lib\net45\NPOI.dll - - - ..\packages\NPOI.2.4.1\lib\net45\NPOI.OOXML.dll - - - ..\packages\NPOI.2.4.1\lib\net45\NPOI.OpenXml4Net.dll - - - ..\packages\NPOI.2.4.1\lib\net45\NPOI.OpenXmlFormats.dll - - - - - C:\Program Files\Autodesk\Revit 2019\RevitAPI.dll - False - - - C:\Program Files\Autodesk\Revit 2019\RevitAPIUI.dll - False - - - - ..\packages\System.ComponentModel.Annotations.4.7.0\lib\net461\System.ComponentModel.Annotations.dll - - - - - - - - - - - - - - - - - - False - ..\packages\triangle\sourceCode\sourceCode\Triangle.NET\Triangle\bin\Debug\Triangle.dll - + + + + + + + ..\lib\uBIM.UI.dll - - - - - - DesignDataEntryWindow.xaml - - - - - - - - MassCutEverythingWindow.xaml - - - - - PileCheckWindow.xaml - - - - - True - True - Resources.resx - - - - - - - - - - - - - - - - - Form - - - ProgressForm.cs - - - - True - True - Resource.resx - - - - - - - - - ProgressForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - ResXFileCodeGenerator - Resource.Designer.cs - uBIM_EarthTools - - - - - - - - - - - - - - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - \ No newline at end of file +