qhwkjttkztdtocuckgrttdbhsbwwnxbqmxbrpvhkbzy
- 在revit安装目录下找到 RevitAddInUtility.dll
- 在项目中引用
mjmnbxuxrtnzj
- 使用以下方法
- using Autodesk.RevitAddIns;amenauiaubimsstbnjyredsstkpemda
- pzvjuczudtfnrrkhhytwqxcvaxotgswoapyfzeghyfoe
- /// <summary>zzbbpnjphppbngw
- /// 获取指定版本的Revit安装目录rrtakovyapntlx
- /// </summary>zthzvacrgtrumlqdrhzxsdeirpositihiq
- /// <param name="revitVersion"></param>pzvjuczudtfnrrkhhytwqxcvaxotgswoapyfzeghyfoe
- /// <returns></returns>rvphacldnqjosowgkaihqaihqtbxlup
- public static string GetAllRevitInstallPath(RevitVersion revitVersion)amenauiaubimsstbnjyredsstkpemda
- {tbrzhyecawrqefu
- var revitProducts = GetAllRevitProducts();tbrzhyecawrqefu
- RevitProduct revit = revitProducts.Find(x => (int)x.Version ==(int) revitVersion);
sutskquqquysjhhrulmyfgplkwiqruqjqekgucy
- if (revit != null)ycnhbggmxbgfmzifokiut
- {
hocfyywvavlcawvzxnock
- return revit.InstallLocation;
csaeadjmtxsaedcakphfeyztnuiyezby
- }
sutskquqquysjofugutdgqrkuaoornvhmwvoxwllofitmifvuscvbqrxire
- else
srjnfctbmntzhqxohaxqdswhtadvfaycaofugutdgqrkuaoornvhmwvoxwllofitmifvuscvbqrxire
- {rrtakovyapntlx
- throw new Exception($"未安装{revitVersion}");hrgfcamcwrpiedtaluiohhukayrumrshfqsgjps
- }epfwswlytmnbkjyhwywwnssyyerhrqawupfihuhprcq
- }zzbbpnjphppbngw
- /// <summary>pnmglkerkqejzbhhmgyswjsnrupmuxvvmchftkd
- /// 获取本机所有Revit安装信息vgplqnwqddqtspufxiqho
- /// </summary>rrtakovyapntlx
- /// <returns></returns>tbrzhyecawrqefu
- public static List<RevitProduct> GetAllRevitProducts()
srjnfctbmntzhqxohaxqdswhtadvfayca zsutohhzdsbtmhiffuxddpqpjhbizjoib
- {
mjmnbxuxrtnzj
- return RevitProductUtility.GetAllInstalledRevitProducts();epfwswlytmnbkjyhwywwnssyyerhrqawupfihuhprcq
- }
- ojwkbxxwwxobrmjlywqobn
复制代码ovcvzzixtvayfnxoadegxskdhlteeeulpzmgbsomzzbbpnjphppbngw
mbusgftzhpqzdgwqbukwdzdpqq
clxyzzriwsqbw
https://www.lmlphp.com/user/16591/article/item/491207/mjmnbxuxrtnzj
ovcvzzixtvayfnxoadegxskdhlteeeulpzmgbsomwjbvlxgyzrvheabom zthzvacrgtrumlqdrhzxsdeirpositihiq hhrulmyfgplkwiqruqjqekgucyujezlmmnpztfmgofremqevthj |