分享乙個CAD實體搜尋類

2021-06-13 12:43:52 字數 2786 閱讀 8927

使用方法如下:

可以搜尋多段線、圓、塊參照、擴充套件資料,可以指定圖層、線型、塊名等

以下是實體搜尋類

* @author xuhaiyan

* @date 2013-02-27

* @version 1.0

* @description 

* @dependence .net 2.0

*/ using system;

using system.collections.generic;

using system.text;

using autodesk.autocad.databaseservices;

using comalg = common.algorithm;

using autodesk.autocad.editorinput;

using autodesk.autocad.geometry;

namespace common.acad08

public class searchcondition

set

}public string layername

set

}public string linetypename

set

}public string blockname

set

}public searchcondition()

public searchcondition(primitivetype entitytype)

public searchcondition(primitivetype entitytype, string layername)

public searchcondition(string layername, string linetypename)

public searchcondition(primitivetype entitytype, string layername, string linetypename)

public selectionfilter getselectionfilter()

if ("" != m_linetypename)

if ("" != m_blockname)

if (0 != m_entitytype)

else if (pt == primitivetype.polyline)

else if (pt == primitivetype.blockreference)

else if (pt == primitivetype.circle)}}

if (sb.length > 0)

}if (values.count > 0)

return m_selectionfilter;}}

public class entitysearch

set

}public entitysearch()

public listgetsearchresult()

}return re;

}public listgetsearchresult(point3dcollection windowpolygon)

}return re;

}public listgetsearchresultaspline()}}

}}return re;

}public listgetsearchresultasblockrefrence()}}

}}return re;

}public listgetsearchresultascircle()}}

}}return re;

}private common.algorithm.circle converttocircle(circle circle)

}return re;

}public comalg.blockreference converttoblockreference(blockreference blockref)

}return re;

}public comalg.polyline2d converttopline(line line)

public comalg.polyline2d converttopline(polyline pl)

comalg.polyline2d pline = new common.algorithm.polyline2d(pts);

pline.objectid = pl.objectid.tostring();

pline.linetypename = pl.linetype;

pline.linewidth =   cadbase.converttolineweightvalue(pl.lineweight);

pline.constantwidth = pl.constantwidth;

pline.linescale = pl.linetypescale;

return pline;

}private dictionaryconvertxdatatoxdatastruct(resultbuffer resultbuffer)

caxdata = new common.algorithm.xdata();

}else if (tvs[i].typecode == (short)dxfcode.extendeddataasciistring)

}return re;}}

return re;

}private comalg.point2d converttopoint2d(point3d pt3d)}}

以下是實體搜尋類

將乙個實體類當做屬性放入另乙個實體類裡

在某些業務需求下我們可能要講兩部分資料合併,接下來我們說一下集合合併的這種方式,假設我們有a類 b類 那麼將b類作為屬性放在a類裡面 private listtestb 作為a類的乙個屬性 接下來我們查詢a類的時候通過a表的某個條件去查詢b表將之放入testb屬性當中 下面看 上圖吧 看起來可能不太...

分享乙個Redis幫助類

在專案中用到了redis的hash集合,但是servicestack封裝的使用起來不方便,於是就自己封裝了乙個dll,利用的servicestack的pool來動態建立iredisclient例項,建立了乙個抽象類redisoperatorbase封裝了一些基本方法。比較簡單,相信大家一看 就會。下...

分享乙個PHP除錯日誌類

分享乙個我自己用的在 wordpress 開發中用得到的乙個除錯日誌類。author suifengtec coolwp.com date 2013 02 03 09 55 55 last modified by suifengtec coolwp.com last modified time 20...