using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using FWindSoft.Common; using FWindSoft.Revit; using FWindSoft.Revit.Menu; using FWindSoft.WindowsApi; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LRH.Tool { [Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] [Button(ButtonName = "句柄获取")] public class ViewHandleCommand : ExternalCommand { public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { var handle=WinAPI.FindChildWindowByTitle(App.MainHandle, RevitCore.Doc.ActiveView.Title); return Result.Succeeded; } } }