Example #1
0
 /// <summary>
 /// Generate new addin files for all applicable
 /// versions of Revit.
 /// </summary>
 /// <param name="products">A collection of revit installs.</param>
 /// <param name="excludePath">The path that will not be used to search for Dynamo Revit installations</param>
 internal static void GenerateAddins(IRevitProductCollection products, string excludePath = null)
 {
     Console.WriteLine("Generating addins...");
     foreach (var prod in products.Products)
     {
         var subfolder = prod.VersionString.Insert(5, "_");
         Func <string, string> fileLocator =
             p => Path.Combine(p, subfolder, "DynamoRevitDS.dll");
         var dynRevitProducts = Utilities.LocateDynamoInstallations(null, fileLocator);
         if (null == dynRevitProducts)
         {
             Console.WriteLine("Dynamo Revit Not Installed!");
         }
         foreach (KeyValuePair <string, Tuple <int, int, int, int> > dynRevitProd in dynRevitProducts)
         {
             if (dynRevitProd.Key == excludePath)
             {
                 continue;
             }
             var path = Path.Combine(dynRevitProd.Key, subfolder, "DynamoRevitVersionSelector.dll");
             Console.WriteLine(path);
             if (File.Exists(path))
             {
                 var addinData = DynamoAddinData.Create(prod, dynRevitProd.Key);
                 if (null != addinData)
                 {
                     GenerateDynamoAddin(addinData);
                 }
             }
         }
     }
 }
Example #2
0
        /// <summary>
        /// Generate new addin files for all applicable
        /// versions of Revit.
        /// </summary>
        /// <param name="products">A collection of revit installs.</param>
        /// <param name="dynamos">DynamoProducts, a collection of installed Dynamo
        /// on this system.</param>
        /// <param name="dynamoUninstallPath">Path of Dynamo being uninstalled</param>
        internal static void GenerateAddins(IRevitProductCollection products, DynamoProducts dynamos, string dynamoUninstallPath = "")
        {
            foreach (var prod in products.Products)
            {
                Console.WriteLine("Generating addins in {0}", prod.AddinsFolder);

                var addinData = DynamoAddinData.Create(prod, dynamos, dynamoUninstallPath);
                if (null != addinData)
                {
                    GenerateDynamoAddin(addinData);
                }
            }
        }