Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 public BodyVm(
     RevitService service,
     IReadOnlyCollection <Document> docs,
     OptionsVm optionsVm)
 {
     Docs     = docs;
     _service = service;
     Tabs     = _service.Providers.Select(x => new TabVm(x, docs, optionsVm)).ToList();
 }
Esempio n. 3
0
 public MainViewModel(RevitService service)
 {
     _service = service;
     Options  = new OptionsViewModel();
 }
Esempio n. 4
0
 public MainVm(RevitService service)
 {
     _service = service;
     Options  = new OptionsVm();
 }