{"id":2878,"date":"2015-01-08T01:50:00","date_gmt":"2015-01-07T17:50:00","guid":{"rendered":"http:\/\/www.jiafanglei.com\/?p=2878"},"modified":"2022-01-08T01:50:43","modified_gmt":"2022-01-07T17:50:43","slug":"autocad-net%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91-commandmethod","status":"publish","type":"post","link":"http:\/\/www.jiafanglei.com\/en\/archives\/2878","title":{"rendered":"AutoCAD .NET\u4e8c\u6b21\u5f00\u53d1\u2014\u2014CommandMethod"},"content":{"rendered":"\n<p>\u4eca\u5929\u4e13\u95e8\u8bb2\u4e00\u4e2a\u2014\u2014CommandMethod\u3002\u6211\u4eec\u90fd\u5728\u77e5\u9053CAD\u64cd\u4f5c\u8981\u5feb\uff0c\u5fc5\u987b\u8981\u719f\u6089\u638c\u63e1\u5404\u79cd\u547d\u4ee4\u3002\u5728Lisp\u5f00\u53d1\u4e2d\uff0c\u5728\u51fd\u6570\u540eC:\u5373\u53ef\u6dfb\u52a0\u4e00\u4e2a\u547d\u4ee4\uff0c\u975e\u5e38\u65b9\u6cd5\uff0c\u5728.NET API\u4e5f\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u7684\u8bbe\u7f6e\u547d\u4ee4\uff0c\u5b83\u9700\u8981CommandMethod\u5c5e\u6027\u3002<\/p>\n\n\n\n<p>\u5148\u6765\u770bCommandMethod\u7684\u5b9a\u4e49\uff0c\u5b83\u7684\u6784\u9020\u51fd\u6570\u5f88\u591a\uff0c\u5176\u4e2d\u53c2\u6570\u6700\u5168\u7684\u4e00\u4e2a\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/ss0.baidu.com\/6LVYsjip0QIZ8Aqbn9fN2DC\/timg?pa&amp;quality=100&amp;size=w4096&amp;sec=1487418807&amp;di=c3046820196fde4a4c633a227054c132&amp;ref=http:\/\/www.cnblogs.com\/liweis\/p\/4561226.html&amp;src=http:\/\/images0.cnblogs.com\/blog\/388559\/201506\/081611110041863.png\" alt=\"AutoCAD\u00a0<wbr&gt;.NET\u4e8c\u6b21\u5f00\u53d1\u2014\u2014CommandMethod\" title=\"AutoCAD\u00a0<wbr&gt;.NET\u4e8c\u6b21\u5f00\u53d1\u2014\u2014CommandMethod\"\/><\/figure>\n\n\n\n<p>groupName\u7ec4\u540d\uff0cstring\uff0c\u547d\u4ee4\u7f16\u7ec4\u540d\u79f0\uff0c\u4e00\u822c\u5728\u5c0f\u9879\u76ee\u5f00\u53d1\u4e2d\u7528\u5f97\u6bd4\u8f83\u5c11\u3002<\/p>\n\n\n\n<p>globalName,\u5168\u5c40\u540d\u79f0\uff0c string\uff0c\u5373\u547d\u4ee4\uff0c\u5b83\u5e94\u8be5\u662f\u552f\u4e00\u7684\uff0c\u4e0d\u7136\u5728\u8c03\u7528\u65f6\u4f1a\u53d1\u751f\u610f\u5916\u3002<\/p>\n\n\n\n<p>localizedNameId, \u672c\u5730\u540d\u79f0\uff0cstring\uff0c\u6307\u5b9a\u8bed\u8a00\u7684\u672c\u5730\u547d\u4ee4\u540d\u79f0\uff0c\u4e0d\u77e5\u9053\u6709\u4ec0\u4e48\u7528\u3002<\/p>\n\n\n\n<p>flags, \u547d\u4ee4\u6807\u5fd7\uff0cCommandFlags\uff0c\u5b9a\u4e49\u547d\u4ee4\u7684\u884c\u4e3a\u3002\u8be6\u89c1\u9644\u8868\u3002<\/p>\n\n\n\n<p>contextMenuExtensionType, \u4e0a\u4e0b\u6587\u83dc\u5355\u7c7b\u578b\u6807\u5fd7 \uff0cType\uff0c \u5b9a\u4e49\u547d\u4ee4\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u65f6\u7684\u4e0a\u4e0b\u6587\u83dc\u5355\u884c\u4e3a\u3002<\/p>\n\n\n\n<p>helpFileName, \u5e2e\u52a9\u6587\u4ef6\u540dstring\uff0c\u5e2e\u52a9\u6587\u4ef6\uff0c\u542b\u6709\u547d\u4ee4\u6d3b\u52a8\u72b6\u6001\u4e0b\u6309\u4e0bF1\u65f6\u8981\u663e\u793a\u7684\u5e2e\u52a9\u4e3b\u9898\u3002<\/p>\n\n\n\n<p>helpTopic \uff0c\u5e2e\u52a9\u4e3b\u9898\uff0cstring\u3002\u5e2e\u52a9\u6587\u4ef6\u4e2d\u7684\u4e3b\u9898\u3002<\/p>\n\n\n\n<p>\u9664\u4e0a\u9762\u8fd9\u4e2a\u6784\u9020\u51fd\u6570\u5916\uff0c\u5b83\u8fd8\u67095\u4e2a\uff1a<\/p>\n\n\n\n<p>CommandMethodAttribute(string globalName)<\/p>\n\n\n\n<p>CommandMethodAttribute(string globalName, CommandFlags flags)<\/p>\n\n\n\n<p>CommandMethodAttribute(string groupName, string globalName, CommandFlags flags)<\/p>\n\n\n\n<p>CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags)<\/p>\n\n\n\n<p>CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, string helpTopic)<\/p>\n\n\n\n<p>CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType)<\/p>\n\n\n\n<p>\u5728\u4f7f\u7528\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u6709\uff1a<\/p>\n\n\n\n<p>\uff081\uff09CommandMethodAttribute\u548cCommandMethod\u662f\u4e00\u4e2a\uff0c\u4e0d\u7ba1\u4f7f\u7528\u54ea\u4e00\u4e2a\u90fd\u53ef\u4ee5\uff1b<\/p>\n\n\n\n<p>\uff082\uff09CommandMethodAttribut\u7684\u4f7f\u7528\u9700\u8981\u6dfb\u52a0\u76f8\u5173\u5f15\u7528\uff0c\u5305\u62ecaccoremgd\uff0cacdbmgd\u548cacmgd\u4e09\u4e2a\uff1b<\/p>\n\n\n\n<p>\uff083\uff09CommandMethod\u540e\u7684\u6709\u6548\u884c\u5fc5\u987b\u662f\u4e00\u4e2a\u51fd\u6570\u3002<\/p>\n\n\n\n<p><strong>\u9644\u8868<\/strong>\uff1aCommand Flags\u547d\u4ee4\u6807\u5fd7<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td>\u679a\u4e3e\u503c<\/td><td>\u63cf\u8ff0<\/td><\/tr><\/thead><tbody><tr><td>ActionMacro<\/td><td>\u53ef\u4ee5\u7528\u52a8\u4f5c\u5f55\u5236\u5668\u5f55\u5236\u547d\u4ee4\u52a8\u4f5c\uff1b<\/td><\/tr><tr><td>DocReadLock<\/td><td>\u547d\u4ee4\u6267\u884c\u65f6\u5c06\u88ab\u53ea\u8bfb\u9501\u5b9a\uff1b<\/td><\/tr><tr><td>Interruptible<\/td><td>\u63d0\u793a\u7528\u6237\u8f93\u5165\u65f6\u53ef\u4ee5\u4e2d\u65ad\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>Modal<\/td><td>\u522b\u7684\u547d\u4ee4\u8fd0\u884c\u65f6\u4e0d\u80fd\u8fd0\u884c\u6b64\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>NoActionRecording<\/td><td>\u4e0d\u80fd\u7528\u52a8\u4f5c\u5f55\u5236\u5668\u5f55\u5236\u547d\u4ee4\u52a8\u4f5c\uff1b<\/td><\/tr><tr><td>NoBlockEditor<\/td><td>\u4e0d\u80fd\u4ece\u5757\u7f16\u8f91\u5668\u4f7f\u7528\u8be5\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>NoHistory<\/td><td>\u4e0d\u80fd\u5c06\u547d\u4ee4\u6dfb\u52a0\u5230repeat-last-command\uff08\u91cd\u590d\u4e0a\u4e00\u4e2a\u547d\u4ee4\uff09\u5386\u53f2\u5217\u8868\uff1b<\/td><\/tr><tr><td>NoPaperSpace<\/td><td>\u4e0d\u80fd\u4ece\u56fe\u7eb8\u7a7a\u95f4\u4f7f\u7528\u8be5\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>NoTileMode<\/td><td>\u5f53TILEMODE\u7f6e1\u65f6\u4e0d\u80fd\u4f7f\u7528\u8be5\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>NoUndoMarker<\/td><td>\u547d\u4ee4\u4e0d\u652f\u6301\u64a4\u9500\u6807\u8bb0\u3002\u7528\u4e8e\u4e0d\u4fee\u6539\u6570\u636e\u5e93\u56e0\u800c\u4e5f\u5c31\u65e0\u9700\u51fa\u73b0\u5728\u64a4\u9500\u8bb0\u5f55\u4e2d\u7684\u90a3\u4e9b\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>Redraw<\/td><td>\u4e0d\u6e05\u7a7a\u53d6\u56de\u7684\u5148\u9009\u62e9\u540e\u6267\u884c\u8bbe\u7f6e\u53ca\u5bf9\u8c61\u6355\u6349\u8bbe\u7f6e\uff1b<\/td><\/tr><tr><td>Session<\/td><td>\u547d\u4ee4\u8fd0\u884c\u4e8e\u5e94\u7528\u7a0b\u5e8f\u4e0a\u4e0b\u6587\uff0c\u800c\u4e0d\u662f\u5f53\u524d\u56fe\u5f62\u6587\u6863\u4e0a\u4e0b\u6587\uff1b<\/td><\/tr><tr><td>Transparent<\/td><td>\u522b\u7684\u547d\u4ee4\u8fd0\u884c\u65f6\u53ef\u4ee5\u8fd0\u884c\u6b64\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>Undefined<\/td><td>\u53ea\u80fd\u901a\u8fc7\u5168\u5c40\u540d\u4f7f\u7528\u547d\u4ee4\uff1b<\/td><\/tr><tr><td>UsePickSet<\/td><td>\u6e05\u7a7a\u53d6\u56de\u7684\u5148\u9009\u62e9\u540e\u6267\u884c\u8bbe\u7f6e\uff1b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u6ce8\u610f, \u5f53\u4f7f\u7528 implifiedselection \u7684\u65f6\u5019, \u9700\u8981  \u5728commandmethod \u91cc\u52a0\u5165 Command Flags .usepickset. <br>\u4f46\u662f\u6267\u884c\u5b8c\u547d\u4ee4\u4f1a\u6e05\u7a7a\u9009\u62e9. \u6240\u6709\u5982\u679c\u6700\u540e\u9ad8\u4eae\u4e00\u4e9b\u56fe\u5143(ed.setimplifiedselection)\u65f6,\u9700\u8981\u6dfb\u52a0Redraw\u547d\u4ee4,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u4e13\u95e8\u8bb2\u4e00\u4e2a\u2014\u2014CommandMethod\u3002\u6211\u4eec\u90fd\u5728\u77e5\u9053CAD\u64cd\u4f5c\u8981\u5feb\uff0c\u5fc5\u987b\u8981\u719f\u6089\u638c\u63e1\u5404\u79cd\u547d\u4ee4\u3002\u5728Lisp\u5f00\u53d1\u4e2d\uff0c\u5728\u51fd\u6570\u540eC:\u5373\u53ef\u6dfb\u52a0\u4e00\u4e2a\u547d\u4ee4\uff0c\u975e\u5e38\u65b9\u6cd5\uff0c\u5728.NET API\u4e5f\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u7684\u8bbe\u7f6e\u547d\u4ee4\uff0c\u5b83\u9700\u8981CommandMethod\u5c5e\u6027\u3002 \u5148\u6765\u770bCommandMethod\u7684\u5b9a\u4e49\uff0c\u5b83\u7684\u6784\u9020\u51fd\u6570\u5f88\u591a\uff0c\u5176\u4e2d\u53c2\u6570\u6700\u5168\u7684\u4e00\u4e2a\u5982\u4e0b\u56fe\u6240\u793a\uff1a groupName\u7ec4\u540d\uff0cstring\uff0c\u547d\u4ee4\u7f16\u7ec4\u540d\u79f0\uff0c\u4e00\u822c\u5728\u5c0f\u9879\u76ee\u5f00\u53d1\u4e2d\u7528\u5f97\u6bd4\u8f83\u5c11\u3002 globalName,\u5168\u5c40\u540d\u79f0\uff0c string\uff0c\u5373\u547d\u4ee4\uff0c\u5b83\u5e94\u8be5\u662f\u552f\u4e00\u7684\uff0c\u4e0d\u7136\u5728\u8c03\u7528\u65f6\u4f1a\u53d1\u751f\u610f\u5916\u3002 localizedNameId, \u672c\u5730\u540d\u79f0\uff0cstring\uff0c\u6307\u5b9a\u8bed\u8a00\u7684\u672c\u5730\u547d\u4ee4\u540d\u79f0\uff0c\u4e0d\u77e5\u9053\u6709\u4ec0\u4e48\u7528\u3002 flags, \u547d\u4ee4\u6807\u5fd7\uff0cCommandFlags\uff0c\u5b9a\u4e49\u547d\u4ee4\u7684\u884c\u4e3a\u3002\u8be6\u89c1\u9644\u8868\u3002 contextMenuExtensionType, \u4e0a\u4e0b\u6587\u83dc\u5355\u7c7b\u578b\u6807\u5fd7 \uff0cType\uff0c \u5b9a\u4e49\u547d\u4ee4\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u65f6\u7684\u4e0a\u4e0b\u6587\u83dc\u5355\u884c\u4e3a\u3002 helpFileName, \u5e2e\u52a9\u6587\u4ef6\u540dstring\uff0c\u5e2e\u52a9\u6587\u4ef6\uff0c\u542b\u6709\u547d\u4ee4\u6d3b\u52a8\u72b6\u6001\u4e0b\u6309\u4e0bF1\u65f6\u8981\u663e\u793a\u7684\u5e2e\u52a9\u4e3b\u9898\u3002 helpTopic \uff0c\u5e2e\u52a9\u4e3b\u9898\uff0cstring\u3002\u5e2e\u52a9\u6587\u4ef6\u4e2d\u7684\u4e3b\u9898\u3002 \u9664\u4e0a\u9762\u8fd9\u4e2a\u6784\u9020\u51fd\u6570\u5916\uff0c\u5b83\u8fd8\u67095\u4e2a\uff1a CommandMethodAttribute(string globalName) CommandMethodAttribute(string globalName, CommandFlags flags) CommandMethodAttribute(string groupName, string globalName, CommandFlags flags) CommandMethodAttribute(string groupName, string globalName, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":66,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[1,52],"tags":[26],"class_list":["post-2878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-other","category-useful-info","tag-solution"],"translation":{"provider":"WPGlobus","version":"2.8.2","language":"en","enabled_languages":["zh","en"],"languages":{"zh":{"title":true,"content":true,"excerpt":false},"en":{"title":false,"content":false,"excerpt":false}}},"_links":{"self":[{"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/posts\/2878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/comments?post=2878"}],"version-history":[{"count":2,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/posts\/2878\/revisions"}],"predecessor-version":[{"id":2880,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/posts\/2878\/revisions\/2880"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/media\/66"}],"wp:attachment":[{"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/media?parent=2878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/categories?post=2878"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jiafanglei.com\/en\/wp-json\/wp\/v2\/tags?post=2878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}