Esempio n. 1
0
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            if (commandData == null)
            {
                return(Result.Failed);
            }

            var  vm     = new ViewModels.RunScriptViewModel(commandData, elements);
            bool?result = SCaddinsApp.WindowManager.ShowDialog(vm, null, ViewModels.RunScriptViewModel.DefaultViewSettings);

            return(Result.Succeeded);
        }
Esempio n. 2
0
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            if (commandData == null)
            {
                return(Result.Failed);
            }

            var  vm     = new ViewModels.RunScriptViewModel();
            bool?result = SCaddinsApp.WindowManager.ShowDialog(vm, null, ViewModels.RunScriptViewModel.DefaultViewSettings);

            if (result.HasValue && result.Value)
            {
                RunScript(commandData.Application.ActiveUIDocument.Document, vm.Script);
            }

            return(Result.Succeeded);
        }