添加项目文件。

This commit is contained in:
GG Z
2026-02-23 16:57:09 +08:00
parent 63b7094528
commit ebf06999d0
109 changed files with 7194 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.Attributes;
using System.Threading.Tasks;
namespace DotNet.RevitUI.Helper
{
/// <summary>
/// Revit命令帮助.
/// </summary>
[Transaction(TransactionMode.Manual)]
class RevitCommandInvoke : IExternalCommand
{
public static Queue<ExecuteHandler> ExecuteHandlers { get; set; }
public static Queue<InvokeHandler> InvokeHandlers { get; set; }
static RevitCommandInvoke()
{
ExecuteHandlers = new Queue<ExecuteHandler>();
InvokeHandlers = new Queue<InvokeHandler>();
}
Result IExternalCommand.Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
while (ExecuteHandlers.Count > 0)
{
var first = ExecuteHandlers.Dequeue();
first(commandData, ref message, elements);
}
while (InvokeHandlers.Count > 0)
{
var first = InvokeHandlers.Dequeue();
first(commandData.Application);
}
return Result.Succeeded;
}
}
delegate Result ExecuteHandler(ExternalCommandData commandData, ref string message, ElementSet elements);
delegate void InvokeHandler(UIApplication uiApp);
}