Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public static string GetRevitAddinsFolderPath(SupportedRevitVersion revitVersion, Environment.SpecialFolder specialFolder)
 {
     return(Path.Combine(Environment.GetFolderPath(specialFolder), REVIT_ADDINS_RELATIVE_PATHS[revitVersion]));
 }
Beispiel #4
0
 public static string GetRevitVersionText(SupportedRevitVersion revitVersion)
 {
     return(SUPPORTED_REVIT_VERSION_NUMBERS.ContainsKey(revitVersion) ?
            SUPPORTED_REVIT_VERSION_NUMBERS[revitVersion] : "UNSUPPORTED");
 }
Beispiel #5
0
 public static bool IsRevitVersionInstalled(SupportedRevitVersion revitVersion)
 {
     return(File.Exists(GetRevitExecutableFilePath(revitVersion)));
 }
Beispiel #6
0
 public static string GetRevitLocalFolderPath(SupportedRevitVersion revitVersion)
 {
     return(REVIT_LOCAL_FOLDER_PATHS.ContainsKey(revitVersion) ?
            REVIT_LOCAL_FOLDER_PATHS[revitVersion] : null);
 }
Beispiel #7
0
        public static string GetRevitExecutableFilePath(SupportedRevitVersion revitVersion)
        {
            var folderPath = GetRevitExecutableFolderPath(revitVersion);

            return((folderPath != null) ? Path.Combine(folderPath, REVIT_EXECUTABLE_FILE_NAME) : null);
        }