在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 5570|回复: 13

[原创] debug切换层次skill代码

[复制链接]
发表于 2018-4-11 09:56:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
新手刚开始学习skill,把公司前辈们留下的代码进行了更改,功能是进行选中层次的层次切换,其中有两个工艺,希望该程序在两个工艺中都能适用,代码如下,找不到错误,不会debug,求大神们指点
hiSetBindKey("layout" "<key>1" "convertm2tom1()")
procedure(changeLayer()
let((tech tw tv)
tw=hiGetCurrentWindow()
tv=geGetEditCellView()
tech=ciCacheLibName(tv)
if(tech == "s18_tech"
then
procedure(convertm2tom1()
prog((cw cv selObjects i)
cw=hiGetCurrentWindow()
cv=geGetEditCellView()
selObjects=geGetSelSet(cv)
for(i 0 length(selObjects)-1
selObjects~>layerNum=70
);for
return(t)
);prog
);procedure
else
procedure(convertm2tom1()
prog((cw cv selObjects i)
cw=hiGetCurrentWindow()
cv=geGetEditCellView()
selObjects=geGetSelSet(cv)
for(i 0 length(selObjects)-1
selObjects~>layerNum=44
);for
return(t)
);prog
);procedure
);if
);let
);procedure
发表于 2018-4-12 11:09:59 | 显示全部楼层
你报了个啥错?
 楼主| 发表于 2018-4-12 15:33:39 | 显示全部楼层
回复 2# yuanhuan
报的错是:syntax error found at line1 column 5 of file *ciwInPort*
              *Error* lineread/read:syntax error encountered in input
发表于 2018-4-20 22:05:54 | 显示全部楼层
试试改成:
hiSetBindKey("Layout" "<key>1" "changeLayer()“)
发表于 2018-5-7 14:12:38 | 显示全部楼层
LZ,hiSetBindKey("Layout" "<Key>1" "convertm2tom1()");;;;<Key>首字母需要大写的。
 楼主| 发表于 2018-5-17 12:03:09 | 显示全部楼层
回复 4# z20102760

谢谢哦,我按你说的改了以后没有语法错误了。不过这个代码还有很多其他的问题,正在继续优化中。。。。。。
 楼主| 发表于 2018-5-17 12:06:37 | 显示全部楼层
回复 5# jiangtaojack
谢谢你的提醒哦,我一直没有注意过这个问题。已经改成大写了。我去查了一下以前的代码,有些用的大写有些用的小写,貌似都能用,看来是大小写都可以的。不过标准的layout bindkey里面是用的大写。
发表于 2018-6-28 21:13:27 | 显示全部楼层
回复 1# rebecca2018
Sorry no Chinese input at this computer.
Finally understand the purpose of your code. To be honest, I have not seen this kind of structure before: procedure inside procedure. Theoretically this can work, but you may end up with some issue due to different user cases.


I modify your code a little bit, have not really try this code yet, it should be easier to debug.

procedure(convertm2tom1()
prog((cw cv tech selObjects i layerMun)
  cw=hiGetCurrentWindow()
  cv=geGetEditCellView()
  selObjects=geGetSelSet(cv)


  tech=ciCacheLibName(cv)
  if(tech == "s18_tech" then

    layerNum = 70
  else
    layerNum = 44
  );if

  for(i 0 length(selObjects)-1
    selObjects~>layerNum=layerNum

  );for
  return(t)
);prog
);procedure


hiSetBindKey("Layout" "<key>1" "convertm2tom1()")




The thought is simple, you define the value of layerNum by detecting the technology.
And then apply to all the selected objects.
发表于 2018-7-2 18:51:50 | 显示全部楼层
Debug 要使用SKILL IDE 调试才比较好定位
发表于 2018-8-22 14:51:47 | 显示全部楼层
非常感谢+1
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-26 11:31 , Processed in 0.027702 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表