| | |
| | | using Autodesk.Revit.Attributes;
|
| | | using Autodesk.Revit.DB;
|
| | | using Autodesk.Revit.UI;
|
| | | using DevExpress.Internal.WinApi.Windows.UI.Notifications;
|
| | | using DevExpress.XtraPrinting.Native;
|
| | | using HStation.RevitDev.Model.ModelEnum;
|
| | | using HStation.RevitDev.RevitDataExport.Common;
|
| | |
| | | namespace HStation.RevitDev.RevitDataExport
|
| | | {
|
| | | /// <summary>
|
| | | /// 系统分类
|
| | | /// 导入
|
| | | /// </summary>
|
| | | [Transaction(TransactionMode.Manual)]
|
| | | public class SystemSelect : IExternalCommand
|
| | |
| | | m_data = commandData;
|
| | |
|
| | | doc.UpdataDocumentCache();
|
| | | m_uiapp.Idling += App_Idling;
|
| | | RevitCommandId id = RevitCommandId.LookupPostableCommandId(PostableCommand.ShowDisconnects);
|
| | | if (uiapp.CanPostCommand(id))
|
| | | {
|
| | | uiapp.PostCommand(id);
|
| | | }
|
| | | var results = SystemCheckUtils.SystemCheck(m_data);
|
| | | SystemCheckUtils.ShowCheckResult(m_uiapp, results);
|
| | | //m_uiapp.Idling += App_Idling;
|
| | | //RevitCommandId id = RevitCommandId.LookupPostableCommandId(PostableCommand.ShowDisconnects);
|
| | | //if (uiapp.CanPostCommand(id))
|
| | | //{
|
| | | // uiapp.PostCommand(id);
|
| | | //}
|
| | |
|
| | | return Result.Succeeded;
|
| | | }
|
| | |
|
| | | private void App_Idling(object sender, Autodesk.Revit.UI.Events.IdlingEventArgs e)
|
| | | {
|
| | | if (m_isFirstTrigger)
|
| | | {
|
| | | m_isFirstTrigger = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | SystemCheckUtils.SystemCheck(m_data);
|
| | | m_uiapp.Idling -= App_Idling;
|
| | | m_isFirstTrigger = true;
|
| | | }
|
| | | }
|
| | | //private void App_Idling(object sender, Autodesk.Revit.UI.Events.IdlingEventArgs e)
|
| | | //{
|
| | | // if (m_isFirstTrigger)
|
| | | // {
|
| | | // m_isFirstTrigger = false;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // var results = SystemCheckUtils.SystemCheck(m_data);
|
| | | // SystemCheckUtils.ShowCheckResult(m_uiapp, results);
|
| | | // m_uiapp.Idling -= App_Idling;
|
| | | // m_isFirstTrigger = true;
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | var doc = commandData.Application.ActiveUIDocument.Document;
|
| | | doc.UpdataDocumentCache();
|
| | | CacheUtil.SaveCache(commandData.Application.ActiveUIDocument.Document);
|
| | | TaskDialog.Show("提示", "导出完成!");
|
| | | var result = CacheUtil.ExportZipFile(commandData.Application.ActiveUIDocument.Document, out string err);
|
| | | if (result)
|
| | | TaskDialog.Show("提示", "文件导出完成!");
|
| | | else TaskDialog.Show("提示", "导出失败," + err);
|
| | | return Result.Succeeded;
|
| | | }
|
| | | }
|