{ SearchCADText
function SearchCADText(strFind:String;Layer:string;underLine,mGroup:Boolean;var Point:variant):boolean;
精确查找和定位 CAD 中文字,支持两个单行文字的组合,或是一个多行文字,如:
strFind:要查找的文字
Laye:所在图层,==’’ 时在所有图层中查找
underline:是否带下划线
mGroup:组合查找,两个单行文字,之间用眼镜符'@-@'分隔(随你怎么更改)
Point: 返回要查找文字的坐标
}
//找两个单行文字的组合的下面一个
function SearchCADNextText(Layer:string;P:Variant;s2:string):string;
var
j,C:integer;t:string;
p1,p2:Variant;
begin
result:='';
p1:=VarArrayCreate([0,2],vt_R8);
p2:=VarArrayCreate([0,2],vt_R8);
p1[0]:=P[0]; p1[1]:=P[1]-5;p1[2]:=0;
p2[0]:=P[0]+10; p2[1]:=P[1];p2[2]:=0;
p[0]:=(p1[0]+p1[0]) div 2;
p[1]:=(p1[1]+p1[1]) div 2;
PantoCadCenter(p);//移动到中心点,为什么不移过去就找不到?
Set_Select2.Clear;
fType[0]:=0;//字符串定义的对象类型,如单行文字'text'
fType[1]:=8;//字符串定义的图层名,如'仪表'
FilterData[0]:='text';
FilterData[1]:=Layer;
Set_Select2.Select(0,p1,p2,fType,FilterData);
for j:=0 to Set_Select2.count-1 do begin
t:=Set_Select2.item(j).TextString;
if ((t=s2)and(s2<>'*'))or((s2='*')and(t<>'')) then begin
result:=t;
评论1
最新资源