在Visual Studio引用对话框中找不到Civil 3D 2011 64位的COM组件的解决办法
如果您使用的是64位操作系统,安装了Civil 3D 64bit做开发时,可能会发现在Visual Studio的添加引用对话框中找不到Civil 3D的COM组件了。在64位操作系统下需要重新注册一下。在32位操作系统下没有这个问题。
我们知道Civil 3D开发中提供的基于COM的API,在我们基于COM API开发Civil 3D应用程序时可能会使用到下面几个引用:
Autodesk Civil Engineering 8.0 Land Object Library
Autodesk Civil Engineering 8.0 UI Land Object Library
Autodesk Civil Engineering 8.0 Corridor Object Library
Autodesk Civil Engineering 8.0 UI Corridor Object Library
Autodesk Civil Engineering 8.0 PipeObject Library
Autodesk Civil Engineering 8.0 UI Pipe Object Library
Autodesk Civil Engineering 8.0 Survey Object Library
Autodesk Civil Engineering 8.0 UI Survey Object Library
正常情况下,你可以在Visual Studio 2008的添加引用对话框中的COM选项卡中找到他们。但如果您使用的是64位操作系统,可能在COM选项卡中找不到这些库。他们对应的库文件保存在C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 80
解决办法就是需要注册一下,你可以运行这个注册表文件(8.0_civil_engineering_x64_registration.reg),文件内容如下,你可以拷贝然后粘贴到记事本中,保存为*.reg文件,双击导入注册表:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\TypeLib]
[HKEY_CLASSES_ROOT\TypeLib\{E932008F-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E932008F-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E932008F-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E932008F-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXLand.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E9360002-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E9360002-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E9360002-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E9360002-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXPipe.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E9380001-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E9380001-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E9380001-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E9380001-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXSurvey.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E9350001-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E9350001-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E9350001-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E9350001-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXUiRoadway.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E9370001-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E9370001-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E9370001-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E9370001-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXUiPipe.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E9390001-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E9390001-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E9390001-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E9390001-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXUiSurvey.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E9330001-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E9330001-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E9330001-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E9330001-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXUiLand.tlb"
[HKEY_CLASSES_ROOT\TypeLib\{E934002E-0050-4186-8DF9-3D5372B7DC57}]
[HKEY_CLASSES_ROOT\TypeLib\{E934002E-0050-4186-8DF9-3D5372B7DC57}\8.0]
[HKEY_CLASSES_ROOT\TypeLib\{E934002E-0050-4186-8DF9-3D5372B7DC57}\8.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{E934002E-0050-4186-8DF9-3D5372B7DC57}\8.0\0\win32]
@="C:\\Program Files\\Common Files\\Autodesk Shared\\Civil Engineering 80\\AeccXRoadway.tlb"
注册成功后你应该能在添加引用的COM选项卡中找到上述的几个库:
8.0_civil_engineering_x64_registration.reg.zip
Cheers!