一下是我的代码,得到的Contact参数和设置的不一致。
procedure(AddRectContactM2_M1c()
let((upperRightY upperRightX lowerRightY lowerRightX boxHeight boxWidth rows columns listbox centerx centery Grid)
Grid=0.005
listbox=enterBox()
upperRightY=cadadr(listbox);
upperRightX=caadr(listbox);
lowerRightY=cadar(listbox);
lowerRightX=caar(listbox);
boxHeight=upperRightY-lowerRightY;
boxWidth=upperRightX-lowerRightX;
rows=truncate((boxHeight-0.12+0.26)/0.52);calculate the rows,remains the integer.
columns=truncate((boxWidth-0.12+0.26)/0.52);calculate the columns
centerx=float(round((upperRightX+lowerRightX)/2/Grid)*Grid);calculate the x coordnate and set it to the grid
centery=float(round((upperRightY+lowerRightY)/2/Grid)*Grid);calculate the y coordnate and set it to the grid
if(rows!=0&&columns!=0
then
leCreateContact(geGetEditRep() "M2_M1c" centerx:centery "R0" 0.06 0.06 rows columns 0.26 0.26 "center" "center")
)
);end let
; AddRectContactM2_M1c()
);end procedure
hiSetBindKey("Layout" "Shift<Key>F11" "AddRectContactM2_M1c()" )