|
@@ -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);
|
|
|
}
|