/// <inheritdoc/> public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { try { var app = commandData.Application.Application; var revitEvent = new RevitEvent(); var revitService = new RevitService(app, revitEvent); var mainVm = new MainVm(revitService); var renamerWindow = new RenamerWindow() { DataContext = mainVm }; renamerWindow.Show(); } catch (PluginException e) { message = e.Message; if (e.Elements.Count > 0) { foreach (var element in e.Elements) { elements.Insert(element); } } return(Result.Failed); } catch (Exception e) { message = e.Message; return(Result.Failed); } return(Result.Succeeded); }
public BodyVm( RevitService service, IReadOnlyCollection <Document> docs, OptionsVm optionsVm) { Docs = docs; _service = service; Tabs = _service.Providers.Select(x => new TabVm(x, docs, optionsVm)).ToList(); }
public MainViewModel(RevitService service) { _service = service; Options = new OptionsViewModel(); }
public MainVm(RevitService service) { _service = service; Options = new OptionsVm(); }