| | |
| | | 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;
|
| | | using HStation.RevitDev.RevitDataExport.Forms;
|
| | |
| | | namespace HStation.RevitDev.RevitDataExport
|
| | | {
|
| | | /// <summary>
|
| | | /// 系统分类
|
| | | /// 导入
|
| | | /// </summary>
|
| | | [Transaction(TransactionMode.Manual)]
|
| | | public class SystemSelect : IExternalCommand
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 构件导入
|
| | | /// 构件分类
|
| | | /// </summary>
|
| | | [Transaction(TransactionMode.Manual)]
|
| | | public class AutoClassified : IExternalCommand
|
| | |
| | | {
|
| | | DocumentUtil.RegistViewEvent(commandData);
|
| | | DocumentUtil.RegistDocumentEvent(commandData);
|
| | | DockablePaneUtils.ShowInstancePanel(commandData);
|
| | | commandData.Application.ActiveUIDocument.Document.UpdataDocumentCache();
|
| | | GlobalResource.InstancePanel.UpdateForm();
|
| | | DockablePaneUtils.ShowInstancePanel(commandData);
|
| | | return Result.Succeeded;
|
| | | }
|
| | | }
|
| | |
| | | public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
| | | {
|
| | | var doc = commandData.Application.ActiveUIDocument.Document;
|
| | | commandData.Application.ActiveUIDocument.Document.UpdataDocumentCache();
|
| | | CacheUtil.HideOrShowModels(commandData.Application.ActiveUIDocument.Document);
|
| | | return Result.Succeeded;
|
| | | }
|
| | |
| | | [Transaction(TransactionMode.Manual)]
|
| | | public class SystemCheck : IExternalCommand
|
| | | {
|
| | | bool m_isFirstTrigger = true;
|
| | | UIApplication m_uiapp = null;
|
| | | ExternalCommandData m_data = null;
|
| | | public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
| | | {
|
| | | var uiapp = commandData.Application;
|
| | | var doc = commandData.Application.ActiveUIDocument.Document;
|
| | | SystemCheckUtils.SystemCheck(commandData);
|
| | | m_uiapp = uiapp;
|
| | | m_data = commandData;
|
| | |
|
| | | doc.UpdataDocumentCache();
|
| | | 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
|
| | | // {
|
| | | // var results = SystemCheckUtils.SystemCheck(m_data);
|
| | | // SystemCheckUtils.ShowCheckResult(m_uiapp, results);
|
| | | // m_uiapp.Idling -= App_Idling;
|
| | | // m_isFirstTrigger = true;
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
| | | {
|
| | | 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;
|
| | | }
|
| | | }
|
| | |
| | | RevitType m_type = RevitType.RFT_Pipe;
|
| | | public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
| | | {
|
| | | Common.GlobalResource.CurrentAddinId = commandData.Application.ActiveAddInId;
|
| | | GlobalResource.CurrentAddinId = commandData.Application.ActiveAddInId;
|
| | | DocumentUtil.RegistDocumentEvent(commandData);
|
| | | DockablePaneUtils.ShowDockablePanel(commandData, m_type);
|
| | | return Result.Succeeded;
|