|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
layout时经常需要编辑一个不属于自己lib的cell,一般会另存到自己lib里面并替换当前cell,再进去进行修改,我将这个过程用脚本实现,可以快速另存并替换当前cell,脚本全文如下,快捷键是Ctrl+3,也可以直接下载附件,如有建议,欢迎回帖讨论
procedure(copy_and_replace(t_lib t_cell)
let((selID selName selLib cvID)
selID=car(geGetSelectedSet())
selName=selID~>cellName
selLib=selID~>libName
cvID=dbOpenCellViewByType(selLib selName "layout" "" "r")
if(dbCopyCellView(cvID t_lib t_cell "layout" nil nil nil)
then leReplaceAnyInstMaster(selID t_lib t_cell "layout")
);if
);let
);copy_and_replace
procedure(copyForm()
let((libList crlib crcell libList_ID cellnameID copyFormID)
libList=ddGetLibList()~>name
crlib=geGetEditCellView()~>libName
crcell=car(geGetSelectedSet())~>cellName
setq(libList_ID
hiCreateCyclicField(
?name 'Lib_list
?prompt "Copy to lib :"
?choices libList
?value crlib
?defValue crlib
?keepHistory t
)
);setq
setq(cellnameID
hiCreateStringField(
?name 'cell_name
?prompt "New cell name :"
?defValue crcell
)
);setq
setq(copyrightID
hiCreateLabel(
?name 'copyright
?labelText "CopyRight by zfy"
)
);setq
setq(copyFormID
hiCreateAppForm(
?name 'copy_form
?formTitle "Copy and Replace"
?fields
list(
list(libList_ID 0:20 200:30 100)
list(cellnameID 0:60 280:30 100)
list(copyrightID 150:100 200:30)
);
?callback list("copyCB()")
)
);setq
hiDisplayForm(copyFormID)
);let
);copyForm
procedure(copyCB()
let((t_lib t_cell)
t_lib=copy_form->Lib_list->value
t_cell=copy_form->cell_name->value
copy_and_replace(t_lib t_cell)
);let
);copyCB
hiSetBindKey("Layout" "Ctrl<key>3" "copyForm()")
|
|