123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using Autodesk.Revit.DB;
- using ServiceRevitLib;
- using System;
- using System.IO;
- //using RevitToJBim.Common;
- namespace ExportStart
- {
- class Program
- {
- static Program()
- {
- RevitCoreContext.Instance.Run();
- }
- [STAThread]
- static void Main(string[] args)
- {
- //RevitCoreContext.Instance.Run();
- string path = @"E:\导出测试\testR17.rvt";
- try
- {
- path = args[0];
-
- string command = "Export";
- var app = RevitCoreContext.Instance.Application;
- var doc = app.OpenDocumentFile(path);
- Export(doc);
- Check(doc);
- //File.AppendAllLines(@"D:\RevitDll.txt",RevitCoreContext.NeedAssemblys );
- RevitCoreContext.Instance.Stop();
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
-
- }
- public static void Export(Document doc)
- {
- try
- {
- Console.WriteLine("Start Export");
- RevitToJBim.MbiExport.Export(doc);
- Console.WriteLine("End Export");
- }
- catch (Exception e)
- {
- Console.WriteLine("导出失败");
- throw;
- Console.WriteLine(e.StackTrace);
- }
- }
- public static void Check(Document doc)
- {
- try
- {
- Console.WriteLine("Start DataCheck");
- ServiceDataCheckTest.Check(doc);
- Console.WriteLine("End DataCheck");
- }
- catch (Exception e)
- {
- Console.WriteLine("导出失败");
- throw;
- Console.WriteLine(e.StackTrace);
- }
- }
- }
- }
|