public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { var uiDel = new ThreadStart(() => { var window = new CancelWindow(); var outputCallBack = new OutputCallback(window.RecordOutput); RevitContext.BindOutput(outputCallBack); window.ShowDialog(); }); var t = new Thread(uiDel); t.SetApartmentState(ApartmentState.STA); t.Start(); return(Result.Succeeded); }
private void CloseClick(object sender, RoutedEventArgs e) { RevitContext.BindOutput(new RevitContext.DummyCallback()); Close(); }