Autocad 中的 Rubberduck

Rubberduck in Autocad

我看到了 v2.0: 75% there post mentions Autocad and there is an AutoCADApp.cs file, but I can't seem to find a reference for using Rubberduck outside of Office, under some random host application. There is this Adding a new Host Application to Rubberduck 但 Autocad 已经完成了。

在 Autocad 下使用 Rubberduck 需要从源代码构建? 或者有没有使用已经安装的发布包的程序?

Disclaimer: I'm heavily involved with the Rubberduck project.

可能您只是缺少 AutoCAD 的 VBE 注册表项来注意到您的小鸭子。

Rubberduck 的安装程序会搜索您安装的 Microsoft Office 的位数,然后使用该位数自行注册。

因此,如果您拥有 32 位 Office 和 32 位 CAD,那么一切就绪。 64 位 Office 和 64 位 CAD 也是如此。在您的情况下,您可能有 32 位 Office 但有 64 位 CAD,因此没有注册表项告诉 64 位 VBE 加载名为 Rubberduck 的加载项。

您可以 运行 您在项目的 wiki 中找到的 PowerShell 脚本(它创建 32 位和 64 位插件密钥),或者手动创建缺少的 HKCU 注册表项,但是插件将是看到了,但仍然不会加载,因为 COM 互操作的东西是在 32 位节点下注册的,而 CAD 期望 RD 在 64 位节点下注册。要注册 64 位,您必须 运行(作为管理员)64 位 regasm.exe 命令,如 "troubleshooting 'add-in could not be loaded'" section of the installer wiki:

中所述

Note: the bitness of your OS is irrelevant.

Bring up an administrative command prompt (cmd.exe), and execute one of the following commands:

32-bit host:

c:\windows\microsoft.net\framework\v4.0.30319\regasm.exe "(path to install folder)\rubberduck.dll" /codebase /tlb

64-bit host:

c:\windows\microsoft.net\framework64\v4.0.30319\regasm.exe "(path to install folder)\rubberduck.dll" /codebase /tlb

请注意,即使您从源代码自行构建插件,也需要执行这些注册步骤。