public static RevitVersion.SupportedRevitVersion?ParseRevitVersionOptionValue(string revitVersionOptionValue) { RevitVersion.SupportedRevitVersion?revitVersion = null; if (!string.IsNullOrWhiteSpace(revitVersionOptionValue)) { if (RevitVersion.IsSupportedRevitVersionNumber(revitVersionOptionValue)) { revitVersion = RevitVersion.GetSupportedRevitVersion(revitVersionOptionValue); } } return(revitVersion); }
public static string ParseRevitVersionOptionValue(string revitVersionOptionValue) { string parsedValue = null; if (!string.IsNullOrWhiteSpace(revitVersionOptionValue)) { if (RevitVersion.IsSupportedRevitVersionNumber(revitVersionOptionValue)) { parsedValue = revitVersionOptionValue; } } return(parsedValue); }
public static bool IsBatchRvtAddinInstalled(RevitVersion.SupportedRevitVersion revitVersion) { bool isAddinInstalled = false; var revitAddinsBaseFolders = new [] { Environment.SpecialFolder.CommonApplicationData, Environment.SpecialFolder.ApplicationData }; var revitAddinsFolderPaths = revitAddinsBaseFolders.Select(f => RevitVersion.GetRevitAddinsFolderPath(revitVersion, f)).ToList(); foreach (var revitAddinsFolderPath in revitAddinsFolderPaths) { var batchRvtAddinFilePath = Path.Combine(revitAddinsFolderPath, BATCHRVT_ADDIN_FILENAMES[revitVersion]); if (File.Exists(batchRvtAddinFilePath)) { isAddinInstalled = true; } } return(isAddinInstalled); }