Kerry 发表于 2015-3-12 04:35:11

AutoCAD 20142015:错误的自定义命令检测

AutoCAD 2014x64, 2015x64.它看起来像一个错误。对于早于AutoCAD 2014的AutoCAD版本,一切正常。写一个简单的“Hello world”:/* © Andrey Bushman, 2015。
* 命令.cs。
*/。

使用系统;。
使用 System.Collections.Generic;。
使用 System.Linq;。
使用 System.Text;。

使用 Rg = System.Text.RegularExpressions;。
使用 Dr = System.Drawing;。
使用 Fr = System.Windows.Forms;。
使用 Wp = System.Windows;。
使用 Wc = System.Windows.Controls;。
使用 Cn = System.Windows.Converters;。

#if AUTOCAD。
using cad = Autodesk.AutoCAD.ApplicationServices.Application;。
使用 Ap = Autodesk.AutoCAD.ApplicationServices;。
使用 Db = Autodesk.AutoCAD.DatabaseServices;。
using Ed = Autodesk.AutoCAD.EditorInput;。
使用 Rt = Autodesk.AutoCAD.Runtime;。
使用 Gm = Autodesk.AutoCAD.Geometry;。
using Br = Autodesk.AutoCAD.BoundaryRepresentation;。
using Hs = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices;。
using Us = Autodesk.AutoCAD.DatabaseServices.SymbolUtilityServices;。
#endif。

#if AUTOCAD && (PLATFORM_x64







**** Hidden Message *****

Kerry 发表于 2015-3-12 04:36:32

PLATFORM_x86)。
using In = Autodesk.AutoCAD.Interop;。
使用 Ic = Autodesk.AutoCAD.Interop.Common;。
#endif。

使用Ex = Bushman.CAD.Extensions.AutoCAD_Net_Extension1;。

[程序集: Rt.CommandClass(typeof(Ex.Commands))]。

命名空间Bushman.CAD.Extensions.AutoCAD_Net_Extension1 {。
公共密封类命令 {。
const String cmdGroup = “Bushman”;。

********************************。
这是一个 CAD 命令模板,不要忘记重命名默认值 。
// 字符串值和方法名称,。
    。
[Rt.CommandMethod(cmdGroup, “test”, “testx”,。
Rt.CommandFlags.Modal)]。
公共无效 RenameMe_Command() {。
Ap.Document doc = cad.DocumentManager.MdiActiveDocument;。
if (null == doc)。
返回;。
Db.Database db = doc.数据库;。
Ed.Editor ed = doc.编辑;。
使用(文档,LockDocument()) {。
using (Db.Transaction tr = db.TransactionManager.StartTransaction()) {。
编辑,写消息(“你好,世界!”);。
断续器Commit();。
}。
}。
}。
********************************。
}。
}编译它并加载到 AutoCAD 2014 或 2015 中,现在我尝试通过某些方式调用我的命令...AutoCAD 显示的现有命令不完整列表(我的命令的全局名称不存在),并且有时调用的不是我想要的,看看我附加的有序屏幕,存在附加文件计数的限制,因此,我通过我的两条消息来做到这一点。

Kean 发表于 2015-3-12 05:01:48

下一个附加文件。

Kean 发表于 2015-3-12 05:23:26

附加信息:当我使用它时:






一切正常。
也就是说,当我定义命令组并尝试调用命令的全局名称而不调用其组名时,存在此问题。如果我在 _ inputsearchpoptions 中取消选中“AutoComplete”选项——一切正常,对于全局名称也是如此(即使它是在没有命令组的情况下调用的)。

Kean 发表于 2015-3-12 05:25:25


安德烈,
我认为应该去ADN
斯蒂芬·普雷斯顿或基恩可能会把它传下去。

Kean 发表于 2015-3-12 05:29:14

我不是 ADN 会员。

Kerry 发表于 2015-3-12 05:40:03

http://www.theswamp.org/index.php?action=profile;u=12242
http://www.theswamp.org/index.php?action=profile;u=2050
发送一个PM并指向此帖子。

Kerry 发表于 2015-3-12 12:16:06

我成功了。谢谢。

Kean 发表于 2015-3-12 14:10:12

尝试删除本地化的NameId参数,看看是否有帮助:

我怀疑加载程序无法找到ID为“testx”的资源,因此根本没有加载DLL。
当然,可能不是这样,但这就是我开始的地方。
肯恩

Kean 发表于 2015-3-13 05:06:54

你不对。本地化命令工作正常。我也找到了这个信息。
页: [1] 2
查看完整版本: AutoCAD 20142015:错误的自定义命令检测