1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
-
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Autodesk.RevitAddIns;
- namespace ExportStart
- {
- public class RevitUtils
- {
-
-
-
-
- public static List<string> GetSearchPath()
- {
- #if DEBUG
- return RevitProductUtility.GetAllInstalledRevitProducts().Where(t => t.Name == "Revit 2017").Select(x => x.InstallLocation).ToList();
- #else
- return new List<string>(){GetRevitDllPath()};
- #endif
- }
- #region dll路径管理
-
-
-
-
- public static string GetRevitDllPath()
- {
- if (!string.IsNullOrWhiteSpace(m_RevitDllPath))
- {
- return m_RevitDllPath;
- }
- return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\\RevitDlls");
- }
- private static string m_RevitDllPath;
- public static void SetRevitDllPath(string path)
- {
- m_RevitDllPath = path;
- }
- #endregion
- }
- }
|