1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using SAGA.DotNetUtils.Revit;
- using System;
- using System.Diagnostics;
- using System.IO;
- namespace StartVisionSelector
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- string path = @"E:\导出测试\testR17.rvt";
-
-
- Console.WriteLine("start");
- #region 保存版本号
-
- var runPath = AppDomain.CurrentDomain.BaseDirectory;
- var revitVision = RevitVisionUtil.GetRevitVision(path);
- File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SelectorConst.RevitFileVisionFile), revitVision);
- #endregion
- #region 删除生成的Revit dll
- var dllsPath = Path.Combine(Directory.GetParent(runPath).Parent.FullName, "Dlls");
- var loadingRevitPath = Path.Combine(dllsPath, SelectorConst.LoadingRevit);
- var revitdlls = Path.Combine(dllsPath, $"Revit{revitVision}");
- var revitdllDirectoryInfo = new DirectoryInfo(revitdlls);
-
- #region Del RevitDll
- foreach (string loadingItem in File.ReadAllLines(loadingRevitPath))
- {
- string destFile = Path.Combine(runPath, $"{loadingItem}.dll");
- if(File.Exists(destFile))
- File.Delete(destFile);
- }
- #endregion
-
- #endregion
- #region Copy RevitAddInUtility.dll
-
-
-
-
-
-
-
- #endregion
- #region 启动
- Process process = new Process();
- process.StartInfo.FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ExportStart.exe");
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.CreateNoWindow = true;
- process.StartInfo.RedirectStandardInput = true;
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.RedirectStandardError = true;
- process.StartInfo.Arguments = "\"" + path + "\"";
- process.Start();
- string msg = process.StandardOutput.ReadToEnd();
- process.WaitForExit();
- process.Close();
- #endregion
- Console.WriteLine("end");
-
- }
- }
- }
|