如何通过C#开发调用Skyline软件中提供的小工具
生活随笔
收集整理的這篇文章主要介紹了
如何通过C#开发调用Skyline软件中提供的小工具
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
熟悉Skyline的朋友會知道,在TerraBuilder和TerraExplorer Pro軟件的安裝目錄里,提供了很多個小工具(exe程序);
雖然我們看不到這些小工具的源代碼,但我們還是可以在自定義的開發環境中來調用它們的;
尤其是可以用來實現一些批量化操作和自動化操作;
常用的小工具:
MakeXpl.exe;
MakeCPT.exe;
Triangulate Irregular Elevation Grid.exe;
Convert XYZ ASCII Elevation.exe;
Convert Z ASCII Elevation.exe;
Gather Tiled Files.exe;
Split and Merge MPU-MPT files.exe
......
用C#調用cmd執行命令,網上可以找到很多使用的方法和參數的設置示例代碼;
#region "運行工具將XYZ轉換成TRI"//運行工具將XYZ轉換成TRI//趙賀 2016.8.19//輸入XYZ文件路徑和TRI文件路徑及采樣精度private void XYZtoTRI(String inputFile, String outputFile, Double resolution){String programName = TempDataPath + @"\ttd.exe"; ;String cmd = "\"" + programName + "\"" + " -InputFile " + inputFile + " -OutputFile " + outputFile + " -Resolution " + resolution + " &exit";using (Process proc = new Process()){proc.StartInfo.CreateNoWindow = true;proc.StartInfo.FileName = "cmd.exe";proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardInput = true;proc.StartInfo.RedirectStandardOutput = true;proc.StartInfo.RedirectStandardError = true;proc.StartInfo.ErrorDialog = false;//proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;proc.Start(); proc.StandardInput.WriteLine(cmd);//proc.StandardInput.AutoFlush = true;//獲取cmd窗口的輸出信息proc.StandardOutput.ReadToEnd(); proc.WaitForExit();//等待程序執行完退出進程proc.Close();}}#endregion
關于如何C#運行cmd,參考了園子里其他朋友的博客:http://www.cnblogs.com/babycool/p/3570648.html#undefined
?
轉載于:https://www.cnblogs.com/yitianhe/p/5845534.html
總結
以上是生活随笔為你收集整理的如何通过C#开发调用Skyline软件中提供的小工具的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 维纳滤波python 函数_图像维纳滤波
- 下一篇: 【Altium Designer】:关于