zoukankan      html  css  js  c++  java
  • Linq对对象进行范围排序

    ObjectIdCollection ids = STools.GetSelection();
                if (ids.Count == 0) return;

                using (Transaction trans = doc.TransactionManager.StartTransaction())
                {
                    List<DBText> sDBTxt = new List<DBText>();
                    foreach (ObjectId id in ids)
                    {
                        DBText sT = trans.GetObject(id, OpenMode.ForWrite) as DBText;
                        sDBTxt.Add(sT);
                    }

            //按x升序排列,按y值降序排列,可以先排序
                    var q0 = from e in sDBTxt
                             orderby e.Position.X
                             orderby e.Position.Y descending
                             select e;
            
            //方法2,推荐
                    var q1 = sDBTxt.Where(p => p.Position.Y < 658 && p.Position.Y > 150);

                    ed.WriteMessage(" 取y坐标值 < 658 且 > 150 的值");
                    foreach (DBText st in q1)
                    {
                        ed.WriteMessage(" Text:{0,-10}Y:{1,-20}", st.TextString, st.Position.Y);
                    }

  • 相关阅读:
    pysam操作sam文件
    NCBI SRA数据库
    通过bed文件获取fasta序列
    利用mysql客户端查询UCSC数据库
    Biopython常用功能模块
    FASTX-Toolkit组件用法
    SQL HAVING用法详解
    jquery获取、改变元素属性值
    《JavaScript DOM编程艺术》
    sublime text3使用心得及个人配置 sublime常用快捷键大全
  • 原文地址:https://www.cnblogs.com/swtool/p/3828982.html
Copyright © 2011-2022 走看看