|
发表于 2024-7-30 22:26:52
|
显示全部楼层
(procedure((TMYpathadderrinf)
hiDisplayAppDBox(?name
gensym('GridlogBox) ?dboxBanner "Check Your Selection" ?dboxText
patherr ?dialogType hicWarningDialog ?dialogStyle
'modal
?buttonLayout
'Close
)
)
)(procedure((TMCpathwidthtoggleminus)
(TMCREADONLY)
let((cv geseltype pthresul pthsegresul selgroupID
newpath
)
geSelObjectsPartiallySelected()
(cv = geGetEditCellView())
if((ref == nil) then
sprintf(patherr "No object is selected.")
(TMYpathadderrinf) else
(geseltype = (ref~>objType))
(pthresul = setof(xx geseltype
(xx != "path")
))
if((pthresul == nil) then
cond(((car(geseltype) == "path")
let((pthlaynmlst pthpurposelst pthpointslst pthwidthlst pthnetnmlst
pthpointslst pthlaynmlst newpath pthwidthlst x
y z a
)
(pthlaynmlst = (ref~>layerName))
(pthpurposelst = (ref~>purpose))
(pthpointslst = (ref~>points))
(pthwidthlst = (ref~>width))
(pthnetnmlst = ((ref~>net)~>name))
(selgroupID = leGetEditFigGroup((getCurrentWindow)))
foreach((x y z a) pthpointslst pthlaynmlst ref pthwidthlst
(newpath = dbCreatePath(cv
list(y
car(pthpurposelst)
)
car(list(x))
(a - 0.01)
))
geSelectObject(newpath)
dbDeleteObject(z)
)
if((selgroupID != nil) then
dbAddFigToFigGroup(selgroupID newpath)
geSelectObject(newpath)
)
printf(" ")
)
)
) else
sprintf(patherr "Warning: Only path could be selected, please check.")
(TMYpathadderrinf)
)
)
)
)
)(hiSetBindKey("Layout" "<Key>KP_Subtract" "TMCpathwidthtoggleminus()"))(
procedure((TMYpathadderrinf)
hiDisplayAppDBox(?name
gensym('GridlogBox) ?dboxBanner "Check Your Selection" ?dboxText
patherr ?dialogType hicWarningDialog ?dialogStyle
'modal
?buttonLayout
'Close
)
)
)(procedure((TMCpathwidthtoggleplus)
(TMCREADONLY)
let((cv geseltype pthresul pthsegresul selgroupID
newpath
)
geSelObjectsPartiallySelected()
(cv = geGetEditCellView())
if((ref == nil) then
sprintf(patherr "No object is selected.")
(TMYpathadderrinf) else
(geseltype = (ref~>objType))
(pthresul = setof(xx geseltype
(xx != "path")
))
if((pthresul == nil) then
cond(((car(geseltype) == "path")
let((pthlaynmlst pthpurposelst pthpointslst pthwidthlst pthnetnmlst
pthpointslst pthlaynmlst newpath pthwidthlst x
y z a
)
(pthlaynmlst = (ref~>layerName))
(pthpurposelst = (ref~>purpose))
(pthpointslst = (ref~>points))
(pthwidthlst = (ref~>width))
(pthnetnmlst = ((ref~>net)~>name))
(selgroupID = leGetEditFigGroup((getCurrentWindow)))
foreach((x y z a) pthpointslst pthlaynmlst ref pthwidthlst
(newpath = dbCreatePath(cv
list(y
car(pthpurposelst)
)
car(list(x))
(a + 0.01)
))
geSelectObject(newpath)
dbDeleteObject(z)
)
if((selgroupID != nil) then
dbAddFigToFigGroup(selgroupID newpath)
geSelectObject(newpath)
)
printf(" ")
)
)
) else
sprintf(patherr "Warning: Only path could be selected, please check.")
(TMYpathadderrinf)
)
)
)
)
)(hiSetBindKey("Layout" "<Key>KP_Add" "TMCpathwidthtoggleplus()"))(
procedure((TMCREADONLY)
let((cv cellname libname n20)
if(((geGetEditCellView()~>mode) == "r") then
(cv = geGetWindowCellView())
(cellname = (cv~>cellName))
(libname = (cv~>libName))
sprintf(n20 "\nYou couldn't run this edit command becasue ( cell: %s lib: %s ) layout view is currentlly in read mode.\nRun the command agian after openning the cellview in edit mode.\nAny question, don't hesitate to contact Tomic.\n\n" cellname libname)
printf(n20)
hiDisplayAppDBox(?name
gensym('trReminderDialogBox) ?dboxBanner "Layout Read Only" ?dboxText
n20 ?dialogType hicErrorDialog ?dialogStyle
'modal
?buttonLayout
'UserDefined ?buttons
'("Make Editable" "Close") ?callback
'("TMCToggleEditReadMode()" "")
)
break()
)
)
)
)(procedure((TMCviaColRows ref deltaRow deltaCol \@optional
(doVerbose nil) "dnng"
)
(TMCREADONLY)
let((techId mid viaHead viaParams row
col newVia
(thefun "TMCviaColRow")
)
unless(((ref~>objType) == "stdVia")
error("%s:ERR00: Please select a standard via\n" thefun)
)
when(member((ref~>orient)
list("R90" "R270" "MYR90" "MXR90")
)
(row = deltaRow)
(deltaRow = deltaCol)
(deltaCol = row)
when(doVerbose
info("[%s] Rotated - row=%L ; col=%L\n" thefun deltaRow deltaCol)
)
)
(techId = techGetTechFile((ref~>cellView)))
(viaHead = (ref~>viaHeader))
(mid = techFindViaDefByName(techId
(viaHead~>viaDefName)
))
(row = max(1
(nth(3
((viaHead~>viaDef)~>params)
) + deltaRow)
))
(col = max(1
(nth(4
((viaHead~>viaDef)~>params)
) + deltaCol)
))
foreach(par
(viaHead~>overrideParams)
case(car(par)
("cutRows"
(row = max(1
(cadr(par) + deltaRow)
))
(viaParams = cons(list("cutRows" row) viaParams))
(row = nil)
)
("cutColumns"
(col = max(1
(cadr(par) + deltaCol)
))
(viaParams = cons(list("cutColumns" col) viaParams))
(col = nil)
)
(t
(viaParams = cons(par viaParams))
)
)
)
when(row
(viaParams = cons(list("cutRows" row) viaParams))
)
when(col
(viaParams = cons(list("cutColumns" col) viaParams))
)
(newVia = dbCreateVia((ref~>cellView) mid
(ref~>xy)
(ref~>orient) viaParams
))
if(dbobjectp(newVia) then
dbDeleteObject(ref)
geSelectObject(newVia) else
error("%s:ERR01: Problem during via creation\n" thefun)
)
(selgroupID = leGetEditFigGroup((getCurrentWindow)))
if((selgroupID == nil) then newVia else
dbAddFigToFigGroup(selgroupID newVia)
geSelectObject(newVia)
)
)
)
)(procedure((TMCviaColRow viaList deltaRow deltaCol)
let(nil
(viaList = setof(via viaList
((via~>objType) == "stdVia")
))
foreach(via viaList
(TMCviaColRows via deltaRow deltaCol)
)
)
)
)(procedure((tmc_toggle_obj_minus)
let((objsel viaone)
(objsel = geGetSelSet())
if((objsel == nil) then
sprintf(patherr "Warning: No object is selected, please check.")
(TMYpathadderrinf)
printf("%s\n\n" patherr)
else
foreach(Object objsel
if((((Object~>objType) == "path") || ((Object~>objType) == "stdVia")) then
cond((((Object~>objType) == "path")
(ref = list(Object))
(TMCpathwidthtoggleminus)
)
(((Object~>objType) == "stdVia")
(viaone = list(Object))
(TMCviaColRow viaone 0 -1)
)
) else
sprintf(patherr "Warning: Only path/via could be selected to toggle width/number, please check.")
(TMYpathadderrinf)
printf("%s\n\n" patherr)
break()
)
)
printf("\nMinus one number/grid.")
)
)
)
)(hiSetBindKey("Layout" "<Key>-" "tmc_toggle_obj_minus()"))(
procedure((tmc_toggle_obj_plus)
let((objsel viaone)
(objsel = geGetSelSet())
if((objsel == nil) then
sprintf(patherr "Warning: No object is selected, please check.")
(TMYpathadderrinf)
printf("%s\n\n" patherr)
else
foreach(Object objsel
if((((Object~>objType) == "path") || ((Object~>objType) == "stdVia")) then
cond((((Object~>objType) == "path")
(ref = list(Object))
(TMCpathwidthtoggleplus)
)
(((Object~>objType) == "stdVia")
(viaone = list(Object))
(TMCviaColRow viaone 0 1)
)
) else
sprintf(patherr "Warning: Only path/via could be selected to toggle width/number, please check.")
(TMYpathadderrinf)
printf("%s\n\n" patherr)
break()
)
)
printf("\nPlus one number/grid.")
)
)
)
)(hiSetBindKey("Layout" "<Key>=" "tmc_toggle_obj_plus()"))(
procedure((TMCToggleEditReadMode)
let((cellnm viewnm libnm lockinfo outinfo)
if(((geGetEditCellView()~>mode) == "r") then
(cellnm = (geGetEditCellView()~>cellName))
(viewnm = (geGetEditCellView()~>viewName))
(libnm = (geGetEditCellView()~>libName))
(lockinfo = geGetLockInfo(libnm cellnm viewnm))
if((lockinfo != "(no data on lock available)") then
sprintf(outinfo "%s/%s/%s is locked by %s." libnm cellnm viewnm
lockinfo
)
hiDisplayAppDBox(?name
gensym('GridlogBox) ?dboxBanner "Layout Locked" ?dboxText
outinfo ?dialogType hicWarningDialog ?dialogStyle
'modal
?buttonLayout
'Close
)
printf(outinfo)
)
)
)
case((geGetEditCellView()~>mode)
("a"
geChangeEditMode("r")
)
("r"
geChangeEditMode("a")
)
)
)
)(hiSetBindKey("Layout" "Super<Key>e" "TMCToggleEditReadMode()"))(
hiSetBindKey("Layout" "<Key>+" "TMCviaColRow( geGetSelSet() 1 0 )")
)(hiSetBindKey("Layout" "<Key>_" "TMCviaColRow( geGetSelSet() -1 0 )"))
|
|