同步操作将从 liuqihong/CADTools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
AutoCad 扩展工具平台
最终程序的组织结构:
CadTools.dll
,NFox.Cad.dll
,NFox.Basal.dll
三个dll到一个目录Plugins
目录CadTools.dll
Plugins
目录里accoremgd.dll
acdbmgd.dll
acmgd.dll
adwindows.dll
cadtools.dll
nfox.basal.dll
nfox.cad.dll
presentationcore,
presentationframework
system.componentmodel.composition
using System.ComponentModel.Composition;
using Autodesk.Windows;
using CADTools;
using Autodesk.AutoCAD.Runtime;
[Export(typeof(IPlugin))]
PluginBase
抽象类MenuTab
属性,具体语法见menutab语法说明MenuTab 其实就是一个RibbonTab的对象,可以按照常规的写法,一步步的生成这个对象,为了简化操作特自定义了一系列的函数来简化构造RibbonTab对象。
语法: new Tab("xxx"){}
语法:new Panel("测试"){}
,需要多少个面板就添加多少个
现在代码类似这个样子:
new Tab("插件平台")
{
new Panel("测试1"){},
new Panel("测试2"){},
new Panel("测试3"){},
...
}
普通按钮语法:
{name, cmd, [image], [toolTip], [size], [orient]}
解释:
{功能名称、功能命令、功能图标[默认缺省]、鼠标悬停提示[默认缺省]、图标大小[默认缺省]、文字和图标的位置[默认缺省]}
name
string类型cmd
string类型image
Bitmap类型toolTip
RibbonToolTip类型size
RibbonItemSize类型orient
Orientation枚举类型换行语法:
{BreakType.xxx}
解释:
BreakType
为一个枚举类型,分别为:
BreakType.Row
按钮换行BreakType.Panel
面板换行,面板换行的效果就是面板下拉显示的那个区域分隔符语法:
{RibbonSeparatorStyle.xxx}
解释:
RibbonSeparatorStyle
为一个枚举类型,分别为:
RibbonSeparatorStyle.Line
直线RibbonSeparatorStyle.Spacer
空白RibbonSeparatorStyle.Invisible
我也不知道是啥下拉按钮语法
new SplitButton("heihei"){}
特殊性提示:
行面板语法
new RowPanel("hoho"){}
特殊性提示:
new Tab("插件平台")
{
new Panel("测试1")
{
{name, cmd, image, toolTip, size, orient},
{name, cmd, image, toolTip, size, orient},
{RibbonSeparatorStyle.Line},
{name, cmd, image, toolTip, size, orient},
{name, cmd, image, toolTip, size, orient},
new SplitButton("heihei")
{
{name, cmd, image, toolTip, size, orient},
{name, cmd, image, toolTip, size, orient},
...
},
new RowPanel("hoho")
{
{name, cmd, image, toolTip, size, orient},
{BreakType.Row}
{name, cmd, image, toolTip, size, orient},
{BreakType.Row}
{RibbonSeparatorStyle.Space},
{name, cmd, image, toolTip, size, orient},
{BreakType.Row}
{name, cmd, image, toolTip, size, orient},
...
},
...
},
new Panel("测试2")
{
},
new Panel("测试3")
{
},
...
}
在下拉按钮中只可添加普通按钮,在行面板中可以添加普通按钮/换行/分隔符/下拉按钮
放心,上述代码在vs里都有自动提示的。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。