EaBIM一直以来积极响应国家“十二五”推进建筑业信息化的号召,对建筑领域的信息技术开展深入技术交流和探讨!致力于打造“BIM-建筑师-生态技术”三位一体综合资源交流共享平台,希望为BIM与可持续设计理念及技术的普及做出微小的贡献!!!

EaBIM

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 842|回复: 3
打印 上一主题 下一主题

如果获取Revit.ini文件在目标机器上的位置

[复制链接]

1514

主题

7465

帖子

1万

积分

admin

Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10Rank: 10

积分
12404

社区QQ达人

跳转到指定楼层
楼主
发表于 2014-1-15 14:09:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

问题:

revit2008-revit2010中的二次开发要修改配置文件revit.ini,请问怎么确定它的位置?


答:


这个文件存储在Revit安装目录下。你可以通过注册表获得Revit的安装路径。请看下面的这个解决方案。前面部分关于RevitAddInUtility.dll 我在一篇博客中谈到


In 2011, we have introduced an external command/application registration utility dll called RevitAddInUtility.dll. It allows the developers to read, write and modify Revit Add-in manifest file (which is also new in 2011). You can also use it to identify the installation location of Revit product as well. The following are few of examples of classes and methods:
  RevitProductUtility.GetAllInstalledRevitProducts --- get a list of Revit products installed on the machine.
  RevitProduct.InstallLocation --- returns the folder path where the revit product is installed.
RevitAddinUtility.dll is a standalone tool and does not depend on other modules of Revit. Revit application developers can freely include it in their installers. (Note: at the time of updating this DevNote, this dll is found in the product install folder. We plan to make this available in other way in future.)
For more information, please take a look at RevitAddInUtility.chm documentation found in the Revit API SDK folder.
Now, if you are developing in Revit 2010 and earlier versions, unfortunately there is no utility. There is not an officially supported way for identifying the installation location of the Revit product install. You will need to check the uninstall information in the Windows system registry. The following is the information to use Uninstall information.
With some other products, typical location to find such information is Windows system registry. But Revit is designed to write into the Windows registry as little as possible. Though it adds some entries to the Windows registry at startup, it cleans up those entries when it exits.
Fortunately, Windows maintains some independent uninstall information in the registry, which we can use to detect some installation information such as the installation folder. The following are some of the Revit product uninstall keys - see further down below.
Revit 2012 Product Code Pattern
From Revit 2012 onwards, the Revit product codes are generated according to the following pattern:
    {7346B4At-uuvv-wwxy-zzzz-705C0D862004}
The alphabetical characters above stand for
20. [0/1]: ProductCode/UpgradeCode
21. [11, 12, ...]: Major release version [11,12]
22. [00, 01, ...]: Release subversion
23. [01/02/03]: RAC/RST/RME
24. [0/1]: Win32/x64
25. [0/1]: Global/Language Pack
26. [0409...]: Language
The last item, represented by 'z', identifies the language. It uses the hexadecimal LCID (HEX LCID) and is defined in the following table:
lang .NET code HEX LCID DEC LCID Language name Codepage
chs zh-CN 0804 2052 Chinese Simplified 936
cht zh-TW 0404 1028 Chinese Traditional 950
csy cs-CZ 0405 1029 Czech 1250
deu de-DE 0407 1031 German 1252
enu en-US 0409 1033 English 1252
esp es-ES 040A 1034 Spanish 1252
fra fr-FR 040C 1036 French 1252
hun hu-HU 040E 1038 Hungarian 1250
ita it-IT 0410 1040 Italian 1252
jpn ja-JP 0411 1041 Japanese 932
kor ko-KR 0412 1042 Korean 949
plk pl-PL 0415 1045 Polish 1250
ptb pt-BR 0416 1046 Brazilian Portuguese 1252
rus ru-RU 0419 1049 Russian 1251
Applying this rule to Revit 2012 for the RAC flavour, 64 bit operating system, initial release and US English generates the following value:
    {7346B4A0-1200-0110-0409-705C0D862004}
Revit 2012:
Revit Architecture 2012 (English) 32-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7346B4A0-1200-0100-0409-705C0D862004}
Revit Structure 2012 (English): 32-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7346B4A0-1200-0200-0409-705C0D862004}
Revit MEP 2012 (English):  32-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7346B4A0-1200-0300-0409-705C0D862004}
Revit Architecture 2012 (English) 64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7346B4A0-1200-0110-0409-705C0D862004}
Revit Structure 2012 (English): 64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7346B4A0-1200-0210-0409-705C0D862004}
Revit MEP 2012 (English):  64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7346B4A0-1200-0310-0409-705C0D862004}
Revit 2011:
Revit Architecture 2011 (English) 32-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4AF99FCA-1D0C-4D5A-9BFE-0D4376A52B23}
Revit Structure 2011 (English): 32-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0EE1FCA9-7474-4143-8F22-E7AD998FACBF}
Revit MEP 2011 (English):  32-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CCCB80C8-5CC5-4EB7-89D0-F18E405F18F9}
Revit Architecture 2011 (English) 64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{94D463D0-2B13-4181-9512-B27004B1151A}
Revit Structure 2011 (English): 64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{23853368-22DD-4817-904B-DB04ADE9B0C8}
Revit MEP 2011 (English):  64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C31F3560-0007-4955-9F65-75CB47F82DB5}
Revit 2010:

Revit Architecture 2010 (English): 64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{2A8EEE2F-4A9E-43D8-AA07-EC8A316B2DEB}}
Revit Structure 2010 (English): 64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{BC9C0A08-DEA4-4138-A7FB-8F68866DB0C1}}
Revit MEP 2010 (English):  64-bit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{5783F2D7-8006-0409-0102-0060B0CE6BBA}}
Revit Architecture 2010 (English) 32-bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{572FBF5D-3BAA-42FF-A468-A54C2C0A17C3}
Revit Structure 2010 (English) 32-bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{939D29FC-B82D-42A7-BB1E-8E3F121505CC}
Revit MEP 2010 (English) 32-bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5C8281B1-B927-495A-A0FF-AB4BDFAE505C}
Revit 2009:
Revit Architecture 2009 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A3A37DA6-70C0-497C-BCB1-148E9EC1D32E}
Revit MEP 2009 (both Chinese and English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E3781DCB-A650-4E66-9B74-67A1B17F052C}
Revit Structure 2009 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C4B3B3C3-2EE9-48D3-9BF5-4443F7ECF759}
Revit 2008:
Revit Architecture 2008 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4A11206C-4377-49E8-911E-B11548658FF3}
Revit MEP 2008 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{60A2743E-C881-4880-94ED-96445E38616F}
Revit Structure 2008 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8D0AE0BB-4FE5-491D-A284-3B363F02E639}
Revit 9.0 and Earlier:
Revit Building 9.0 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D11DB6CB-0332-4735-B312-B919741D975E}
Revit Structural 3 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3F11CEE0-D30D-41ce-8522-922B5D8BB324}
Revit Building 8.1 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7EBC0489-5E47-498D-BE31-B094484612E9}
Revit Structure 2 (English):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BE814F63-629D-4fd8-B628-1437AC10F9D4}
You may want to explore further what entries are used for other Revit products, versions, and languages. Here is a  method to help us detect uninstall keys for other Revit products. Search for the product name under the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
For instance, for Revit Architecture 2009, please search for "Revit Architecture 2009". The search result will be located in a key named "{A3A37DA6-70C0-497C-BCB1-148E9EC1D32E}". For any future version such as Revit Structure XYZ, search for "Revit Structure XYZ", to retrieve the corresponding key name.
Additionally, you can also get the MSI Package code or product code from the msi using, for example, Orca tool, which can be downloaded from several sites. When you open the msi using those tools, then you’ll find the ProductCode in the Property table.

原文链接: http://blog.csdn.net/joexiongjin/article/details/7699790作者:  叶雄进 , Autodesk ADN


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 转播转播 分享分享 分享淘帖 支持支持 反对反对
工作时间:工作日的9:00-12:00/13:30-18:00,节假日不在线,请勿留言

4

主题

864

帖子

1390

积分

BIM经理

Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6Rank: 6

积分
1390
3F
发表于 2014-2-14 10:14:58 | 只看该作者
顶...... 楼下跟上.....
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|EaBIM网 ( 苏ICP备2020058923号-1  苏公网安备32011502011255号

GMT+8, 2024-11-16 16:49

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表