wangwei 3 年之前
父节点
当前提交
32375daff2
共有 1 个文件被更改,包括 27 次插入27 次删除
  1. 27 27
      Starter/Starter/Program.cs

+ 27 - 27
Starter/Starter/Program.cs

@@ -17,7 +17,7 @@ namespace ExportStart
     {
         static Program()
         {
-            //RevitCoreContext.Instance.Run();
+            RevitCoreContext.Instance.Run();
         }
         [STAThread]
         static void Main(string[] args)
@@ -90,32 +90,32 @@ namespace ExportStart
             Log4Net.Info(path);
             if (File.Exists(path) && Enum.TryParse(command, out CommandType commandType))
             {
-                //var app = RevitCoreContext.Instance.Application;
-                //string result = null;
-                //Console.WriteLine("Task StartTime:" + DateTime.Now);
-                //try
-                //{
-                //    var doc = app.OpenDocumentFile(path);
-                //    switch (commandType)
-                //    {
-                //        case CommandType.DataCheck:
-                //            result = Check(doc, param);
-                //            break;
-                //        case CommandType.DataExport:
-                //            result = Export(doc, param);
-                //            break;
-                //    }
-                //}
-                //catch (Exception e)
-                //{
-                //    JObject errorJObject = new JObject();
-                //    errorJObject.Add("ResultMsg", e.Message);
-                //    errorJObject.Add("Result", "Failure");
-                //    result = errorJObject.ToString();
-                //}
-                //SaveResult(param, result);
-                //Console.WriteLine("Task EndTime:" + DateTime.Now);
-                //RevitCoreContext.Instance.Stop();
+                var app = RevitCoreContext.Instance.Application;
+                string result = null;
+                Console.WriteLine("Task StartTime:" + DateTime.Now);
+                try
+                {
+                    var doc = app.OpenDocumentFile(path);
+                    switch (commandType)
+                    {
+                        case CommandType.DataCheck:
+                            result = Check(doc, param);
+                            break;
+                        case CommandType.DataExport:
+                            result = Export(doc, param);
+                            break;
+                    }
+                }
+                catch (Exception e)
+                {
+                    JObject errorJObject = new JObject();
+                    errorJObject.Add("ResultMsg", e.Message);
+                    errorJObject.Add("Result", "Failure");
+                    result = errorJObject.ToString();
+                }
+                SaveResult(param, result);
+                Console.WriteLine("Task EndTime:" + DateTime.Now);
+                RevitCoreContext.Instance.Stop();
 
                 StartRevitSimplify(path, param);
             }