几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » ObjectARX(VB.NET/C#)
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-20, 05:19 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】[转帖]用.net实现autocad实体的多重选择

[转帖]用.net实现autocad实体的多重选择
www.dimcax.com
[转帖]用.net实现autocad实体的多重选择
转帖自,其中过滤curve类型的实体,用到了dxfcode.subclass。在使用.net开发autocad时,获取的选择集可以用selectionfilter对象进行过滤,这样用户就可以只选择对自己操作有用的实体了。关于这个selectionfilter选择过滤器,偶以前只知道用dxfcode.start组码来过滤单种类形的实体(如直线、圆、圆弧等)。今天在才鸟兄的指点下,找到了几个多重选择cad实体的方法,现总结如下:
只过滤直线实体
promptselectionoptions curoption = new promptselectionoptions(); curoption.singleonly = false; curoption.allowduplicates = false; curoption.messageforadding = "请选择曲线:"; typedvalue[] fillist = new typedvalue[]{ new typedvalue((int)dxfcode.start,"line") };//只过滤直线 selectionfilter filter = new selectionfilter(fillist); promptselectionresult ssr = ed.getselection(curoption, filter);

同时过滤直线、圆和圆弧
promptselectionoptions curoption = new promptselectionoptions(); curoption.singleonly = false; curoption.allowduplicates = false; curoption.messageforadding = "请选择曲线:"; typedvalue[] fillist = new typedvalue[]{ new typedvalue((int)dxfcode.start,"line,arc,circle") };//同时过滤直线、圆和圆弧 selectionfilter filter = new selectionfilter(fillist); promptselectionresult ssr = ed.getselection(curoption, filter);
过滤所有曲线
promptselectionoptions curoption = new promptselectionoptions(); curoption.singleonly = false; curoption.allowduplicates = false; curoption.messageforadding = "请选择曲线:"; typedvalue[] fillist = new typedvalue[]{ new typedvalue((int)dxfcode.subclass,"curve") };//过滤所有曲线 selectionfilter filter = new selectionfilter(fillist); promptselectionresult ssr = ed.getselection(curoption, filter);
过滤0层上的所有曲线
promptselectionoptions curoption = new promptselectionoptions(); curoption.singleonly = false; curoption.allowduplicates = false; curoption.messageforadding = "请选择曲线:"; typedvalue[] fillist = new typedvalue[]{ new typedvalue((int)dxfcode.subclass,"curve"), new typedvalue((int)dxfcode.layername,"0") };//过滤0层上的所有曲线 selectionfilter filter = new selectionfilter(fillist); promptselectionresult ssr = ed.getselection(curoption, filter);
又学到了好多东西,谢谢老大
书山有路勤为径,学海无涯苦作舟!
这是c#的吗
原帖由 profawkes 于 这是c#的吗
是c#的
c#最适合开发autocad,因为它拥有vb容易的特点,却具有vc++的强大功能。
上面的内容确实很新颖。但再复杂点的过滤表又该如何实现呢?比如要实现0层上的文字和带有属性的块的筛选,其过滤表又该如何构成呢?
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 12:53 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多