返回列表 发帖

[求助] skill offgrid 脚本报错

[求助] skill offgrid 脚本报错

procedure(snap(point newgrid)
prog((stack coord)
stack=nil
foreach(coord point
coord=round(coord/newgrid)*newgrid
stack=append1(stack coord)
)
return(stack)
));proce-prog-snap

procedure(snapgrid(libraryName @optional (cellname nil) (newgrid 0.005))
prog((library librarycell dbcv other box new_box)
if((not stringp(libraryName)) then
println("USAGE snape(libraryname cellname newgrid)")
else
if(stringp(cellname) then
library=ddGetObj(libraryName cellname)
librarycell=list(library)


else
library=ddGetObj(libraryName)
librarycell=library~>cells
);if
when((not library)
if(stringp(cellname) then
printf("ERROR : library \"%s\" or cell \"%s\" not exsit!\n" libraryName cellname)
else
printf("ERROR : library \"%s\" not exsit!\n" libraryName)
);if
return(nil)
);when

foreach(cell librarycell
foreach(view cell~>views
when(view~>name=="layout"
if(stringp(cellname) then
dbcv=dbOpenCellViewByType(libraryName cellname "layout" "maskLayout" "a")
else
dbcv=dbOpenCellViewByType(libraryName view~>cell~>name "layout" "maskLayout" "a")
);if

foreach(shape dbcv~>shapes
other=0

case(shape~>objType
("rect" box=shape~>bBox bbox=1)
("polygon" box=shape~>points bbox=0)
("path" box=shape~>points bbox=0)
(t other=1)
);case

if((other==0) then
new_box=nil

foreach(point box
new_box=append1(new_box snap(point newgrid))
);foreach

if((bbox==1) then
shape~>bBox=new_box
else
shape~>points=new_box
));if-if

);foreach-shape

foreach(inst dbcv~>instances
if((inst~>mosaic==nil)  then
inst~>xy=snap(inst~>xy newgrid)
else
inst~>mosaic~>uX=round(inst~>mosaic~>uX/newgrid)*newgrid
inst~>mosaic~>uY=round(inst~>mosaic~>uY/newgrid)*newgrid
inst~>mosaic~>xy=snap(inst~>mosaic~>xy newgrid)
);if
);foreach-inst

)));when-foreach-view-cell
if(stringp(cellname) then
printf("SUCCESS : library \"%s\" cell \"%s\" snap to newgrid : %1.4f\n" libraryName cellname newgrid)
else
printf("SUCCESS : library \"%s\" snap to newgrid : %1.4f\n" libraryName newgrid)
);if
return(t)
);if
));proce[/code]
各位大佬帮忙看下,在Skill CIW里面load这段程序的时候出现然后输入snap(lib cell grid),
出现下面这条错误
[attach]716936[/attach]

怎样解决这条错误

本帖最后由 samshitao 于 2018-7-11 13:49 编辑

回复 1# samshitao

这个错误,望解答
捕获.PNG

TOP

返回列表

站长推荐 关闭


关注泰科(TE)官方微信送400信元论坛积分!

通过TE官方微信可以搜索到各种连接器、传感器以及多种方案,关注即送400信元!


查看