public static string GetRevitExecutableFolderPath(SupportedRevitVersion revitVersion) { string revitExecutableFolderPath = null; if (REVIT_EXECUTABLE_FOLDER_PATHS.ContainsKey(revitVersion)) { revitExecutableFolderPath = REVIT_EXECUTABLE_FOLDER_PATHS[revitVersion] .FirstOrDefault(folderPath => File.Exists(Path.Combine(folderPath, REVIT_EXECUTABLE_FILE_NAME))); } return(revitExecutableFolderPath); }
public static string GetRevitLocalFilePath(SupportedRevitVersion revitVersion, string centralFilePath) { string localFilePath = null; var localFolderPath = GetRevitLocalFolderPath(revitVersion); if (localFolderPath != null) { var localFileName = Path.GetFileNameWithoutExtension(centralFilePath) + "_" + Environment.UserName + Path.GetExtension(centralFilePath); localFilePath = Path.Combine(localFolderPath, localFileName); } return(localFilePath); }
public static string GetRevitAddinsFolderPath(SupportedRevitVersion revitVersion, Environment.SpecialFolder specialFolder) { return(Path.Combine(Environment.GetFolderPath(specialFolder), REVIT_ADDINS_RELATIVE_PATHS[revitVersion])); }
public static string GetRevitVersionText(SupportedRevitVersion revitVersion) { return(SUPPORTED_REVIT_VERSION_NUMBERS.ContainsKey(revitVersion) ? SUPPORTED_REVIT_VERSION_NUMBERS[revitVersion] : "UNSUPPORTED"); }
public static bool IsRevitVersionInstalled(SupportedRevitVersion revitVersion) { return(File.Exists(GetRevitExecutableFilePath(revitVersion))); }
public static string GetRevitLocalFolderPath(SupportedRevitVersion revitVersion) { return(REVIT_LOCAL_FOLDER_PATHS.ContainsKey(revitVersion) ? REVIT_LOCAL_FOLDER_PATHS[revitVersion] : null); }
public static string GetRevitExecutableFilePath(SupportedRevitVersion revitVersion) { var folderPath = GetRevitExecutableFolderPath(revitVersion); return((folderPath != null) ? Path.Combine(folderPath, REVIT_EXECUTABLE_FILE_NAME) : null); }