public static List <Level> LetUserPickLevels(Document doc, RevitObjectManager rom) { var levelSelector = new LevelSelectorHost(); levelSelector.InitializeLevelListBox(rom.GetAllLevels(doc)); // clear list from previous selection in case of exporting multiple times SelectedLevels.Clear(); levelSelector.ShowDialog(); // Levels were added by the dialog return(SelectedLevels); }
private static KeyValuePair <Result, Level> OpenLevelSelector(List <Level> levels) { var levelSelectorDialog = new LevelSelectorHost(); levelSelectorDialog.InitializeLevelListBox(levels); // reset from previous plugin execution LevelSelectedByUser = null; levelSelectorDialog.ShowDialog(); if (LevelSelectedByUser == null) { PromtService.ShowInformationToUser("Operation cancelled by User."); return(new KeyValuePair <Result, Level>(Result.Cancelled, null)); } return(new KeyValuePair <Result, Level>(Result.Succeeded, LevelSelectedByUser)); }