|
@@ -12,6 +12,7 @@ using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using Autodesk.RevitAddIns;
|
|
|
+using SAGA.DotNetUtils;
|
|
|
|
|
|
namespace ExportStart
|
|
|
{
|
|
@@ -23,8 +24,23 @@ namespace ExportStart
|
|
|
/// <returns></returns>
|
|
|
public static List<string> GetSearchPath()
|
|
|
{
|
|
|
+ //选择版本时,预先将版本信息写在RevitFileVision.txt文件中,读取版本号
|
|
|
+ var vision = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, StarterConst.RevitFileVisionFile));
|
|
|
+ File.AppendAllText(@"D:\abc.txt",vision);
|
|
|
+
|
|
|
+ File.AppendAllText(@"D:\abc.txt", "\r\n");
|
|
|
+ var revitVision = $"{vision}";
|
|
|
+ var products = SAGA.DotNetUtils.Revit.RevitProductUtility.GetAllInstalledRevitProducts();
|
|
|
+ foreach (var product in products)
|
|
|
+ {
|
|
|
+ File.AppendAllText(@"D:\abc.txt", product.Item1+":"+product.Item2);
|
|
|
+ File.AppendAllText(@"D:\abc.txt", "\r\n");
|
|
|
+ if(product.Item1==vision)
|
|
|
+ File.AppendAllText(@"D:\abc.txt", (product.Item1 == vision).ToString());
|
|
|
+ }
|
|
|
+ return SAGA.DotNetUtils.Revit.RevitProductUtility.GetAllInstalledRevitProducts().Where(t => t.Item1==(revitVision)).Select(t => t.Item2).ToList();
|
|
|
#if DEBUG
|
|
|
- return RevitProductUtility.GetAllInstalledRevitProducts().Where(t => t.Name == "Revit 2017").Select(x => x.InstallLocation).ToList();
|
|
|
+ return RevitProductUtility.GetAllInstalledRevitProducts().Where(t => t.Name == "Revit 2017").Select(x => x.InstallLocation).ToList();
|
|
|
#else
|
|
|
return new List<string>(){GetRevitDllPath()};
|
|
|
#endif
|
|
@@ -44,7 +60,7 @@ namespace ExportStart
|
|
|
}
|
|
|
|
|
|
private static string m_RevitDllPath;
|
|
|
- public static void SetRevitDllPath(string path)
|
|
|
+ public static void SetRevitkDllPath(string path)
|
|
|
{
|
|
|
m_RevitDllPath = path;
|
|
|
}
|