明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4898|回复: 11

[选集] 如何使用selectionset选择某层所有entity?

[复制链接]
发表于 2010-11-15 23:53 | 显示全部楼层 |阅读模式
如何使用selectionset选择某层所有entity,类似于在AutoCAD中使用qselect命令后得到的结果,哪位有代码,能贴上来参考下吗,谢谢了
发表于 2010-11-16 00:01 | 显示全部楼层
过滤器 8 . LayerName
 楼主| 发表于 2010-11-16 00:17 | 显示全部楼层
这个我知道,关键是怎么设置不需要在命令行中输出提示的那种,不需要交换,不知我有没说明白?
发表于 2010-11-16 09:29 | 显示全部楼层
  1.         [CommandMethod("tt6")]
  2.         public static void test26()
  3.         {
  4.             Document doc = Application.DocumentManager.MdiActiveDocument;
  5.             Editor ed = doc.Editor;
  6.             //ResultTree rt =
  7.             //    new ResultTree("or")
  8.             //    {
  9.             //        {0, "circle"},
  10.             //        new ResultTree("and")
  11.             //        {
  12.             //            {0, "lwpolyline"},
  13.             //            new ResultTree("&")
  14.             //            {
  15.             //                {70, 1}
  16.             //            }
  17.             //        }
  18.             //    };
  19.             var resSel = ed.SelectAll(new ResultList { { 8, "01" } });
  20.             if (resSel.Status != PromptStatus.OK)
  21.                 return;
  22.             ed.SetImpliedSelection(resSel.Value.GetObjectIds());
  23.         }
复制代码
 楼主| 发表于 2010-11-17 16:09 | 显示全部楼层
谢谢上面的几位朋友!
发表于 2010-12-3 11:51 | 显示全部楼层
回复 kg_loveyou 的帖子

楼主可有解决方案,分享一下代码或者借口函数吧!
发表于 2010-12-3 12:59 | 显示全部楼层
4楼不是有代码吗
 楼主| 发表于 2010-12-3 21:56 | 显示全部楼层
回复 csu_yijie 的帖子

嗯,就是四楼的函数
发表于 2010-12-5 22:22 | 显示全部楼层
先了解一下,之后在详细学习...
发表于 2010-12-6 11:16 | 显示全部楼层
谢谢狐兄和kg_loveyou,俺愚钝了,没看下面几行代码。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-19 07:40 , Processed in 0.269605 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表