首页 > 其他分享 >Getselection能不能接受keyword?

Getselection能不能接受keyword?

时间:2023-04-24 09:03:09浏览次数:33  
标签:pso keyword ed Getselection Keywords kws psr 接受

这个玩意绝对是个坑,CAD对Getselection的支持并不充分,需要通过keywordinput事件来弄,比较麻烦,而且很容易出问题。

所以我的做法是,不使用,哈哈!

下面这个是kean的代码:

    [CommandMethod("SELKW")]

    public void GetSelectionWithKeywords()
    {
      Document doc = AcadApp.DocumentManager.MdiActiveDocument;
      Editor ed = doc.Editor;
      PromptSelectionOptions pso = new PromptSelectionOptions();
      pso.Keywords.Add("FIrst");
      pso.Keywords.Add("Second");
      string kws = pso.Keywords.GetDisplayString(true);
      pso.MessageForAdding = "\nAdd objects to selection or " + kws;
      pso.MessageForRemoval = "\nRemove objects from selection or " + kws;
      pso.KeywordInput +=
        delegate (object sender, SelectionTextInputEventArgs e)
        {
          ed.WriteMessage("\nKeyword entered: {0}", e.Input);
        };
      PromptSelectionResult psr = ed.GetSelection(pso);
      if (psr.Status == PromptStatus.OK)
      {
        ed.WriteMessage("\n{0} object{1} selected.",
          psr.Value.Count,
          psr.Value.Count == 1 ? "" : "s"
        );
      }
    }

 

标签:pso,keyword,ed,Getselection,Keywords,kws,psr,接受
From: https://www.cnblogs.com/swtool/p/17348322.html

相关文章

  • 关于浏览器的Selection对象,以及window.getSelection()的API用法
    Selection 对象就是用户选择的文本范围或插入符号的位置。它代表页面中的文本选区,可能横跨多个元素。文本选区由用户拖拽鼠标经过文字而产生。具有以下属性和方法。 1、anchorNode只读属性,返回选区开始位置所属的节点。用户可能从左往右框选,也可能从右往左框选。但是锚点......
  • Action 接受参数的3中方式(4)
    Action接受参数的3中方式1.继承ActionSupport的Action在Action中添加字段,这些字段的名字与参数的名字相同,并添加相应的setters与getters方法。packagecom.bjsxt.struts2.user.action;importcom.opensymphony.xwork2.ActionSupport;publicclassUserActionextendsActionSu......
  • HDU 2222 Keywords Search (AC自动机)
    题目地址:HDU2222AC自动机第一发!真好奇这些算法是怎么被发明的。。算法的魅力真是无穷。这题是AC自动机模板题。自己实在写不出来,比着kuangbin的模板写的==代码如下:#include<iostream>#include<string.h>#include<math.h>#include<queue>#include<algorithm>#incl......
  • 用驼峰的实体类接受命名不规范的响应参数
    参考资料地址:https://blog.csdn.net/qq_41143240/article/details/115671561使用JsonProperty注解importcom.alibaba.fastjson.JSON;importcom.fasterxml.jackson.annotation.JsonProperty;importlombok.Data;importjava.util.HashMap;/***用驼峰的实体类接受命......
  • 修正es查询里的字段类型是keyword的query
    defconvert_query(query):"""ConvertElasticsearchquerytousekeywordandtextfieldsappropriately"""ifisinstance(query,dict):forkey,valueinquery.items():ifkeyin["term......
  • 别轻易接受父母的建议
    阅读文本大概需要1.1分钟。张哥,该怎么说服父母关于考研的问题,我本人不想考研,每次打电话微信聊天都和我说考研,考公务员。成年人最大的特征之一就是:自己做决定。我过来人的经验告诉你,父母的建议听听就好,但是绝大部分没多大价值。这不是因为父母不想让我们好,恰恰相反,每个父母绝对是......
  • 一种基于问题、观察和组织的SVVR方法,在文化课程中提高学生的演示表现、课堂参与度和技
    一种基于问题、观察和组织的SVVR方法,在文化课程中提高学生的演示表现、课堂参与度和技术接受度(Aquestion,observation,andorganisation-basedSVVRapproachtoenha......
  • IDEA中SVN未提交代码,更新时有冲突接受其它怎么办
    场景本地有未提交代码,更新代码时提示有冲突,没有选择合并,而是选择接受它们的。实现此时通过svn的查看历史版本无法查看本地的版本。选择文件右键--LocalHistory--ShowHis......
  • WebApi控制器方法接受参数的位置
    FromBody//application/jsonFromForm//前端的默认消息类型FromHeader//从请求头里获取FromQuery//从Url路径中提取FromRoute//从路由中获取FromServices//这......
  • SpringBoot接受前台参数的六种方式以及统一响应
    请求SpringBoot接受前台参数的六种方式,首先因为从前台发送的请求没有界面的话只能是从地址栏发送并且只能是Get请求,为了测试其他的请求,所以我们使用一个工具->Postman,Pos......