Command.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. /* ==============================================================================
  2. * 功能描述:Command
  3. * 创 建 者:Garrett
  4. * 创建日期:2018/3/27 11:42:20
  5. * ==============================================================================*/
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text.RegularExpressions;
  11. using System.Windows;
  12. using Autodesk.Revit.Attributes;
  13. using Autodesk.Revit.DB;
  14. using Autodesk.Revit.DB.ExtensibleStorage;
  15. using Autodesk.Revit.DB.Mechanical;
  16. using Autodesk.Revit.UI;
  17. using CEFSharpWpf;
  18. using SAGA.DotNetUtils;
  19. using SAGA.DotNetUtils.Extend;
  20. using SAGA.DotNetUtils.Logger;
  21. using SAGA.MBI.Calc;
  22. using SAGA.MBI.Common;
  23. using SAGA.MBI.DataArrange;
  24. using SAGA.MBI.Interaction;
  25. using SAGA.MBI.Login;
  26. using SAGA.MBI.Model;
  27. using SAGA.MBI.RequestData;
  28. using SAGA.MBI.Tools;
  29. using SAGA.MBI.WinView;
  30. using SAGA.MBI.WinView.BeModingDutyList;
  31. using SAGA.MBI.WinView.Login;
  32. using SAGA.MBI.WinView.ModeInfoMaintenance;
  33. using SAGA.MBI.WinView.PositionBeaconModeling;
  34. using SAGA.MBI.WinView.Space;
  35. using SAGA.MBI.WinView.Upload;
  36. using SAGA.Models;
  37. using SAGA.RevitUtils;
  38. using SAGA.RevitUtils.Extends;
  39. using SAGA.RevitUtils.Windows;
  40. using Application = Autodesk.Revit.Creation.Application;
  41. using Visibility = System.Windows.Visibility;
  42. namespace SAGA.MBI
  43. {
  44. /// <summary>
  45. /// 打开楼层模型
  46. /// </summary>
  47. [Transaction(TransactionMode.Manual)]
  48. [Regeneration(RegenerationOption.Manual)]
  49. public class OpenModeFileCommand : ExternalCommand, IExternalCommandAvailability
  50. {
  51. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  52. {
  53. try
  54. {
  55. WinOpenFile win = new WinOpenFile();
  56. win.ShowWindow();
  57. }
  58. catch (Exception e)
  59. {
  60. MessageShow.Show(e);
  61. return Result.Cancelled;
  62. }
  63. return Result.Succeeded;
  64. }
  65. /// <summary>
  66. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  67. /// when a document is open.
  68. /// </summary>
  69. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  70. {
  71. return true;
  72. }
  73. }
  74. /// <summary>
  75. /// 模型文件管理
  76. /// </summary>
  77. [Transaction(TransactionMode.Manual)]
  78. [Regeneration(RegenerationOption.Manual)]
  79. public class EditModeFileCommand : ExternalCommand, IExternalCommandAvailability
  80. {
  81. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  82. {
  83. try
  84. {
  85. Log4Net.Debug("开始命令:模型文件管理");
  86. if (DalUploadFloor.IsAllFloorClosed())
  87. {
  88. WinModeFileManage win = new WinModeFileManage();
  89. win.ShowDialog();
  90. }
  91. Log4Net.Debug("结束命令:模型文件管理");
  92. }
  93. catch (Exception e)
  94. {
  95. MessageShow.Show(e);
  96. return Result.Cancelled;
  97. }
  98. return Result.Succeeded;
  99. }
  100. /// <summary>
  101. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  102. /// when a document is open.
  103. /// </summary>
  104. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  105. {
  106. return true;
  107. }
  108. }
  109. /// <summary>
  110. /// 申请模型权限
  111. /// </summary>
  112. [Transaction(TransactionMode.Manual)]
  113. [Regeneration(RegenerationOption.Manual)]
  114. public class LockFloorCommand : ExternalCommand
  115. {
  116. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  117. {
  118. try
  119. {
  120. var doc = ExternalDataWrapper.Current.Doc;
  121. if (doc == null) return Result.Cancelled;
  122. string floorId = doc.PathName.GetFileName();
  123. DalLock.LockFloor(floorId,true);
  124. }
  125. catch (Exception e)
  126. {
  127. MessageShow.Show(e);
  128. return Result.Cancelled;
  129. }
  130. return Result.Succeeded;
  131. }
  132. /// <summary>
  133. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  134. /// when a document is open.
  135. /// </summary>
  136. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  137. {
  138. return false;
  139. }
  140. }
  141. /// <summary>
  142. /// 模型信息点值维护
  143. /// </summary>
  144. [Transaction(TransactionMode.Manual)]
  145. [Regeneration(RegenerationOption.Manual)]
  146. public class EditModeInfoCommand : ExternalCommand//, IExternalCommandAvailability
  147. {
  148. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  149. {
  150. try
  151. {
  152. WinModeInfoMaintenance win = WinModeInfoMaintenance.GetWindow();
  153. if (win.Visibility != Visibility.Visible)
  154. {
  155. win.Show();
  156. IdlingEditInstance.RefrushInstance();
  157. ExternalDataWrapper.Current.UiApp.Idling += IdlingEditInstance.EditInstance_Idling;
  158. }
  159. }
  160. catch (Exception e)
  161. {
  162. MessageShow.Show(e);
  163. ExternalDataWrapper.Current.UiApp.Idling -= IdlingEditInstance.EditInstance_Idling;
  164. return Result.Cancelled;
  165. }
  166. return Result.Succeeded;
  167. }
  168. /// <summary>
  169. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  170. /// when a document is open.
  171. /// </summary>
  172. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  173. {
  174. return false;
  175. }
  176. }
  177. /// <summary>
  178. /// 待建模型清单
  179. /// </summary>
  180. [Transaction(TransactionMode.Manual)]
  181. [Regeneration(RegenerationOption.Manual)]
  182. public class BeModeDutyListCommand : ExternalCommand
  183. {
  184. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  185. {
  186. try
  187. {
  188. Log4Net.Debug("开始命令:待建模型清单");
  189. var doc = ExternalDataWrapper.Current.Doc;
  190. if (doc == null) return Result.Cancelled;
  191. VMBeModeDutyList vm=new VMBeModeDutyList();
  192. WinBeModeDutyList win=new WinBeModeDutyList();
  193. win.DataContext = vm;
  194. win.Show();
  195. Log4Net.Debug("结束命令:待建模型清单");
  196. }
  197. catch (Exception e)
  198. {
  199. MessageShow.Show(e);
  200. return Result.Cancelled;
  201. }
  202. return Result.Succeeded;
  203. }
  204. /// <summary>
  205. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  206. /// when a document is open.
  207. /// </summary>
  208. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  209. {
  210. return false;
  211. }
  212. }
  213. /// <summary>
  214. /// 未实体化模型清单
  215. /// </summary>
  216. [Transaction(TransactionMode.Manual)]
  217. [Regeneration(RegenerationOption.Manual)]
  218. public class ShowMissFMListCommand : ExternalCommand//, IExternalCommandAvailability
  219. {
  220. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  221. {
  222. try
  223. {
  224. Log4Net.Debug("开始命令:未实体化模型清单");
  225. var doc = ExternalDataWrapper.Current.Doc;
  226. if (doc == null) return Result.Cancelled;
  227. string floorId = doc.PathName.GetFileName();
  228. WinMissFMList win = new WinMissFMList(floorId);
  229. win.ShowDialog();
  230. Log4Net.Debug("结束命令:未实体化模型清单");
  231. }
  232. catch (Exception e)
  233. {
  234. MessageShow.Show(e);
  235. return Result.Cancelled;
  236. }
  237. return Result.Succeeded;
  238. }
  239. /// <summary>
  240. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  241. /// when a document is open.
  242. /// </summary>
  243. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  244. {
  245. return false;
  246. }
  247. }
  248. /// <summary>
  249. /// 高亮显示空模型
  250. /// </summary>
  251. [Transaction(TransactionMode.Manual)]
  252. [Regeneration(RegenerationOption.Manual)]
  253. public class HeightLightMissFMListCommand : ExternalCommand//, IExternalCommandAvailability
  254. {
  255. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  256. {
  257. try
  258. {
  259. var doc = ExternalDataWrapper.Current.Doc;
  260. if (doc == null) return Result.Cancelled;
  261. string floorId = doc.PathName.GetFileName();
  262. WinMissFMList win = new WinMissFMList(floorId);
  263. List<Element> ids = win.MissFMEquips.Select(t => doc.GetElement(t.Equipment.BimID.GetBIMID())).Where(tt => tt != null).ToList();
  264. ExternalDataWrapper.Current.UiApp.SetShowElements(ids);
  265. }
  266. catch (Exception e)
  267. {
  268. MessageShow.Show(e);
  269. return Result.Cancelled;
  270. }
  271. return Result.Succeeded;
  272. }
  273. /// <summary>
  274. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  275. /// when a document is open.
  276. /// </summary>
  277. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  278. {
  279. return false;
  280. }
  281. }
  282. /// <summary>
  283. /// 位置信标建模
  284. /// </summary>
  285. [Transaction(TransactionMode.Manual)]
  286. [Regeneration(RegenerationOption.Manual)]
  287. public class PositionBeaconModelingCommand : ExternalCommand//, IExternalCommandAvailability
  288. {
  289. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  290. {
  291. try
  292. {
  293. var doc = ExternalDataWrapper.Current.Doc;
  294. if (doc == null) return Result.Cancelled;
  295. string floorId = doc.PathName.GetFileName();
  296. WinBeacon win = new WinBeacon(floorId);
  297. win.Show();
  298. }
  299. catch (Exception e)
  300. {
  301. MessageShow.Show(e);
  302. return Result.Cancelled;
  303. }
  304. return Result.Succeeded;
  305. }
  306. /// <summary>
  307. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  308. /// when a document is open.
  309. /// </summary>
  310. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  311. {
  312. return false;
  313. }
  314. }
  315. /// <summary>
  316. /// 上传模型
  317. /// </summary>
  318. [Transaction(TransactionMode.Manual)]
  319. [Regeneration(RegenerationOption.Manual)]
  320. public class UploadModeCommand : ExternalCommand, IExternalCommandAvailability
  321. {
  322. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  323. {
  324. try
  325. {
  326. Log4Net.Debug("开始命令:上传模型");
  327. Log4Net.Debug("开始检查:检查所有的模型是否关闭");
  328. if (DalUploadFloor.IsAllFloorClosed())
  329. {
  330. Log4Net.Debug("结束检查:检查所有的模型是否关闭");
  331. Log4Net.Debug("开始检查:是否有需要下载的文件");
  332. if (DalUploadFloor.IsNeedUpdataFile())
  333. return Result.Succeeded;
  334. Log4Net.Debug("结束检查:是否有需要下载的文件");
  335. Log4Net.Debug("开始功能:准备需要上传的数据");
  336. VMUploadModeManage vm = DalUploadFloor.PrepareUploadFloors();
  337. Log4Net.Debug("结束功能:准备需要上传的数据");
  338. WinUploadModeManage win = new WinUploadModeManage();
  339. win.DataContext = vm;
  340. win.ShowDialog();
  341. }
  342. Log4Net.Debug("结束命令:上传模型");
  343. }
  344. catch (Exception e)
  345. {
  346. MessageShow.Show(e);
  347. return Result.Cancelled;
  348. }
  349. return Result.Succeeded;
  350. }
  351. /// <summary>
  352. /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
  353. /// when a document is open.
  354. /// </summary>
  355. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  356. {
  357. return true;
  358. }
  359. }
  360. /// <summary>
  361. /// 空间管理
  362. /// </summary>
  363. [Transaction(TransactionMode.Manual)]
  364. [Regeneration(RegenerationOption.Manual)]
  365. public class CreateSpaceCommand : ExternalCommand, IExternalCommandAvailability
  366. {
  367. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  368. {
  369. var win = new WinCreateSpaces();
  370. win.Show();
  371. return Result.Succeeded;
  372. }
  373. /// <summary>
  374. /// 创建空间分隔符
  375. /// </summary>
  376. /// <param name="doc"></param>
  377. /// <param name="virLines"></param>
  378. /// <param name="deletedPolylines"></param>
  379. public void CreateSpaceSeqarate(Document doc, List<PointPair> virLines, List<int> deletedPolylines)
  380. {
  381. using (Transaction trans = new Transaction(doc, "创建空间分隔符"))
  382. {
  383. trans.Start();
  384. try
  385. {
  386. FailureHandlingOptions fho = trans.GetFailureHandlingOptions();
  387. fho.SetFailuresPreprocessor(new FailuresPreprocessor(false));//这里不对冲突进行捕捉,创建空间的时候会重新捕捉
  388. trans.SetFailureHandlingOptions(fho);
  389. //读取空间所在视图
  390. var view = doc.GetElements<ViewPlan>().FirstOrDefault(t =>
  391. t.Name?.IndexOf("-saga") > -1 && t.ViewType == ViewType.FloorPlan);
  392. if (view == null)
  393. {
  394. MessageBox.Show("无法找到-saga标志的视图");
  395. return;
  396. }
  397. //创建空间分隔符
  398. CreateSpaceSeparationLines(view, doc, virLines);
  399. //删除已有的空间分隔符
  400. doc.Delete(deletedPolylines.Select(id => new ElementId(id)).ToList());
  401. trans.Commit();
  402. }
  403. catch (Exception e)
  404. {
  405. trans.RollBack();
  406. }
  407. }
  408. }
  409. /// <summary>
  410. /// 自动创建空间
  411. /// </summary>
  412. public void AutoCreateSpaces()
  413. {
  414. string SpaceKey = "UKJ";
  415. string ASpaceKey = "UAKJ";
  416. IntPtr mainWindowHandle = RevitProcess.GetMainWindowHandle();
  417. PressHelper.KeyPress(mainWindowHandle, SpaceKey);
  418. ////发送自动放置空间
  419. PressHelper.KeyPress(mainWindowHandle, ASpaceKey);
  420. //ESC
  421. PressHelper.KeyPress(mainWindowHandle, (char)27);
  422. PressHelper.KeyPress(mainWindowHandle, (char)27);
  423. PressHelper.KeyPress(mainWindowHandle, (char)27);
  424. }
  425. /// <summary>
  426. /// 创建空间分隔符
  427. /// </summary>
  428. /// <param name="view"></param>
  429. /// <param name="doc"></param>
  430. /// <param name="pairs"></param>
  431. public static void CreateSpaceSeparationLines(ViewPlan view, Document doc, List<PointPair> pairs)
  432. {
  433. double z = view.GenLevel.Elevation;
  434. //创建
  435. XYZ axis = XYZ.BasisZ;
  436. XYZ vecX = XYZ.BasisX;
  437. XYZ normal = vecX.CrossProduct(vecX.VectorRotate(axis, Math.PI / 2));
  438. Plane p = new Plane(normal, XYZ.Zero);
  439. var sp = SketchPlane.Create(doc, p);
  440. foreach (var pair in pairs)
  441. {
  442. var curveArray = new CurveArray();
  443. XYZ start = pair.RPoint[0].NewZ(z);
  444. XYZ end = pair.RPoint[1].NewZ(z);
  445. Line line = null;
  446. try
  447. {
  448. line = start.NewLine(end);
  449. }
  450. catch (Exception e)
  451. {
  452. Console.WriteLine(e.StackTrace);
  453. }
  454. if (line != null)
  455. {
  456. curveArray.Append(line);
  457. var newLIneId = doc.Create.NewSpaceBoundaryLines(sp, curveArray, view).get_Item(0).Id;
  458. pair.ElementId = newLIneId.IntegerValue;
  459. if (pair.ShowLine != null)
  460. pair.ShowLine.Tag = newLIneId.IntegerValue;
  461. }
  462. }
  463. }
  464. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  465. {
  466. return true;
  467. }
  468. /// <summary>
  469. /// 手动创建空间
  470. /// </summary>
  471. /// <param name="doc"></param>
  472. public void CreateSpace(Document doc)
  473. {
  474. using (Transaction trans = new Transaction(doc, "创建空间"))
  475. {
  476. {
  477. trans.Start();
  478. try
  479. {
  480. //检测是否有空间标记,没有空间标记加载
  481. //doc.LoadFamilySymbolExt(@"C:\ProgramData\Autodesk\RVT 2016\Libraries\China\注释\标记\机械\空间标记.rfa");
  482. doc.LoadFamilySymbolExt(MBIConst.SpaceTagFamilyFilePath);
  483. FailureHandlingOptions fho = trans.GetFailureHandlingOptions();
  484. fho.SetFailuresPreprocessor(new FailuresPreprocessor());
  485. trans.SetFailureHandlingOptions(fho);
  486. var view = doc.GetElements<ViewPlan>().FirstOrDefault(t =>
  487. t.GenLevel?.Name != null && t.Name?.IndexOf("-saga") > -1 &&
  488. t.ViewType == ViewType.FloorPlan);
  489. if (view != null)
  490. {
  491. Parameter para = view.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.VIEW_PHASE);
  492. Autodesk.Revit.DB.ElementId phaseId = para.AsElementId();
  493. var phase = doc.GetElement(phaseId) as Phase;
  494. var level = view.GenLevel;
  495. //如果视图范围不对,也不能很好的创建空间
  496. ICollection<ElementId> elements = doc.Create.NewSpaces2(level, phase, view);
  497. //创建20个未放置的空间
  498. //var spaces= doc.Create.NewSpaces2(phase, 20);
  499. //if (elements == null) MessageBox.Show("无法创建空间,请检查视图范围是否正确!");
  500. }
  501. else
  502. {
  503. Autodesk.Revit.UI.TaskDialog.Show("Revit", "没有找到名称以-saga结尾的平面");
  504. }
  505. doc.Regenerate();
  506. trans.Commit();
  507. }
  508. catch (Exception e)
  509. {
  510. trans.RollBack();
  511. MessageShow.Show(e);
  512. }
  513. }
  514. }
  515. }
  516. }
  517. /// <summary>
  518. /// 存储静态冲突数据
  519. /// </summary>
  520. public class StaticData
  521. {
  522. public static List<List<ElementId>> FailuresPreprocessorData = new List<List<ElementId>>();
  523. }
  524. /// <summary>
  525. /// 事务冲突处理
  526. /// </summary>
  527. public class FailuresPreprocessor : IFailuresPreprocessor
  528. {
  529. readonly bool m_isAdd;
  530. public FailuresPreprocessor(bool isAdd = true)
  531. {
  532. m_isAdd = isAdd;
  533. }
  534. public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor)
  535. {
  536. IList<FailureMessageAccessor> listFma = failuresAccessor.GetFailureMessages();
  537. if (listFma.Count == 0)
  538. return FailureProcessingResult.Continue;
  539. foreach (FailureMessageAccessor fma in listFma)
  540. {
  541. if (fma.GetSeverity() == FailureSeverity.Error)
  542. {
  543. if (fma.HasResolutions())
  544. failuresAccessor.ResolveFailure(fma);
  545. }
  546. if (fma.GetSeverity() == FailureSeverity.Warning)
  547. {
  548. if (m_isAdd)
  549. {
  550. var doc = failuresAccessor.GetDocument();
  551. //获取所有的冲突element
  552. var elementIds = fma.GetFailingElementIds();
  553. StaticData.FailuresPreprocessorData.Add(elementIds.ToList());
  554. }
  555. failuresAccessor.DeleteWarning(fma);
  556. }
  557. }
  558. return FailureProcessingResult.ProceedWithCommit;
  559. }
  560. }
  561. /// <summary>
  562. /// 输出日志,调试用
  563. /// </summary>
  564. public class Logs
  565. {
  566. public static void Log(string msg)
  567. {
  568. var logs = $"{DateTime.Now}======={msg}";
  569. System.Diagnostics.Debug.WriteLine(logs);
  570. // WriteLogs(logs);
  571. }
  572. }
  573. /// <summary>
  574. /// 同步模型本地名称
  575. /// </summary>
  576. [Transaction(TransactionMode.Manual)]
  577. [Regeneration(RegenerationOption.Manual)]
  578. public class SyncLocalNameCommand : ExternalCommand//, IExternalCommandAvailability
  579. {
  580. public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
  581. {
  582. try
  583. {
  584. var floors = DalUploadFloor.GetHasFileFloors();
  585. List<CalcContext> contexts = new List<CalcContext>();
  586. foreach (UploadFloor floor in floors)
  587. {
  588. contexts.Add(new CalcContext(floor.MFloor));
  589. }
  590. MBIModelInfoManager.SyncPlatformToRevit(contexts);
  591. //var doc = ExternalDataWrapper.Current.Doc;
  592. //MBIModelInfoManager.SyncPlatformToRevit(doc);
  593. }
  594. catch (Exception e)
  595. {
  596. MessageShow.Show(e);
  597. return Result.Cancelled;
  598. }
  599. return Result.Succeeded;
  600. }
  601. public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
  602. {
  603. return false;
  604. }
  605. }
  606. }