|
楼主 |
发表于 2024-1-31 21:29:19
|
显示全部楼层
改进之后的源码,有信元就下载支持下,没有就直接copy吧
procedure(selectobj()
let((select_objs cv BOX objs)
select_objs = geGetSelSet()
cv = geGetEditCellView()
BOX=enterBox()
BOX=list(geWindowToEditPoint(hiGetCurrentWindow() xCoord(BOX))
geWindowToEditPoint(hiGetCurrentWindow() yCoord(BOX)))
objs=dbGetOverlaps(cv BOX)
foreach(obj_sl select_objs
case(obj_sl~>objType
("path"
objs_path=setof(x objs x~>objType=="path")
foreach(obj_path objs_path
if((obj_sl ~> lpp == obj_path ~> lpp) &&
(obj_sl ~> width == obj_path ~> width) &&
(sizebox(obj_sl ~> bBox) == sizebox(obj_path ~> bBox))
then
geSelectObject(obj_path)
);if
);foreach
);case_path
("stdVia"
objs_via=setof(x objs x~>objType=="stdVia")
foreach(obj_via objs_via
if((obj_via ~> viaHeader ~> viaDefName == obj_sl ~> viaHeader ~> viaDefName) &&
(sizebox(obj_sl ~> bBox) == sizebox(obj_via ~> bBox))
then
geSelectObject(obj_via)
);if
);foreach_obj_via
);case_via
(t println("This obj_sl isn't I need"))
);case
);foreach
);let
);pre
procedure(sizebox(bBox)
prog((x1 x2 y1 y2 z1 z2 zx zy box_list )
x1=leftEdge(bBox)
x2=rightEdge(bBox)
y1=bottomEdge(bBox)
y2=topEdge(bBox)
z1=x2-x1
z2=y2-y1
sprintf(zx "%f" z1)
sprintf(zy "%f" z2)
box_list=list(zx zy)
return(box_list)
);prog
);procedure
hiSetBindKey("Layout" "<Key>`" "selectobj()") |
|