/*************************************************************************** roceduce: "Auto Create M1 and GT_via on MOS"
;Function: Press "<Key>3" to auto create M1(S/D) GT&CT
;Version: V2.0
;Created by XiangLi on 20/6/2023.
;Bug:
***************************************************************************/
hiSetBindKey("Layout" "<Key>3" "addM1_gt_via()")
procedure(addM1_gt_via()
let((cv tech viaID sels sel tran shapes shape temp1 points start end x0t y0t x1t y1t tempAA bBox center_point y0 y1 tempGT bBox_GT n0 n1 new_GT NEWVIASGate NEWVIASSource)
;Auto Create Vias in area
TechFile=techGetTechFile(geGetEditRep())
CGroupID=cstFindConstraintGroupIn(TechFile "virtuosoDefaultSetup")
MyViaOptions=viaGetViaOptions(CGroupID)
MyViaOptions~>automatic~>minNuMCUts=2
cv=geGetEditCellView()