示例#1
0
        /// <summary>
        /// Returns the version of ASM which is installed with Revit at the requested path.
        /// This version number can be used to load the appropriate libG version.
        /// </summary>
        /// <param name="asmLocation">path where asm dlls are located, this is usually the product(Revit) install path</param>
        /// <returns></returns>
        internal static Version findRevitASMVersion(string asmLocation)
        {
            var lookup      = new InstalledProductLookUp("Revit", "ASMAHL*.dll");
            var product     = lookup.GetProductFromInstallPath(asmLocation);
            var libGversion = new Version(product.VersionInfo.Item1, product.VersionInfo.Item2, product.VersionInfo.Item3);

            return(libGversion);
        }
示例#2
0
        public InstalledProduct(string installLocation, InstalledProductLookUp lookUp)
        {
            var corePath = lookUp.GetCoreFilePathFromInstallation(installLocation);

            InstallLocation = File.Exists(corePath) ? Path.GetDirectoryName(corePath) : installLocation;

            VersionInfo   = lookUp.GetVersionInfoFromFile(corePath);
            ProductName   = string.Format("{0} {1}.{2}", lookUp.ProductLookUpName, VersionInfo.Item1, VersionInfo.Item2);
            VersionString = string.Format("{0}.{1}.{2}.{3}", VersionInfo.Item1, VersionInfo.Item2, VersionInfo.Item3, VersionInfo.Item4);
        }
示例#3
0
        private static void PreloadAsmFromRevit()
        {
            var asmLocation = AppDomain.CurrentDomain.BaseDirectory;

            var lookup  = new InstalledProductLookUp("Revit", "ASMAHL*.dll");
            var product = lookup.GetProductFromInstallPath(asmLocation);

            var dynCorePath       = DynamoRevitApp.DynamoCorePath;
            var libGFolderName    = string.Format("libg_{0}", product.VersionInfo.Item1);
            var preloaderLocation = Path.Combine(dynCorePath, libGFolderName);

            DynamoShapeManager.Utilities.PreloadAsmFromPath(preloaderLocation, asmLocation);
        }