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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
楼主: Jen

[原创] 鼠标滚轮直接修改 Via 的行数和列数skill脚本

[复制链接]
发表于 2022-7-27 14:36:09 | 显示全部楼层
感谢分享
发表于 2022-8-1 14:06:46 | 显示全部楼层
学习了
发表于 2022-8-1 14:07:51 | 显示全部楼层
学习了
发表于 2025-7-22 10:55:13 | 显示全部楼层
我加了一点小功能。减少via数量时,via包边保持在原位置。




  1. row = "row"
  2. col = "column"
  3. hiSetBindKey("Layout" "Shift<Btn4Down>" "NewVia(row  1)")
  4. hiSetBindKey("Layout" "Shift<Btn5Down>" "NewVia(row -1)")
  5. hiSetBindKey("Layout" "Ctrl<Btn4Down>"  "NewVia(col  1)")
  6. hiSetBindKey("Layout" "Ctrl<Btn5Down>"  "NewVia(col -1)") ;定义四个快捷键,调用下面的NewVia函数,并设置里面参数

  7. procedure(NewVia(dir num)   ;定义一个有 dir 和 num 两个参数的函数
  8.     prog((instID viaID rotation  org bBox1 bBox2 dy dx enc1 enc2)
  9.         instID = geGetSelSet()  ;获取被选中器件的ID list
  10.         viaID = setof(obj instID obj~>objType == "stdVia")  ;从获取的inst_ID中筛选出属性为“stdVia”的Via ID list
  11.         rotation = list("R90" "R270" "MYR90" "MXR90")       ;设置一个有四个方向的list,为后面提供判断条件
  12.         foreach(via viaID       ;遍历所有被选中的Via
  13.             bBox1=via~>bBox
  14.             enc1=via~>layer1Enc  
  15.             enc2=via~>layer2Enc
  16.             when(dir == "row"   ;当鼠标输入为修改Via纵向个时
  17.                 if(member(via~>orient rotation) == nil then     ;如果Via的方向不是rotation中的方向,则做以下操作
  18.                     org = via~>cutRows          ;将Via本身纵向的个数赋值给org
  19.                     via~>cutRows = apply('plus list(org num));现在Via纵向个数 = 本身个数 + num
  20.                 else                        ;如果Via的方向是rotation中的方向,则做以下操作
  21.                     org = via~>cutColumns           ;将Via本身横向的个数赋值给org
  22.                     via~>cutColumns = apply('plus list(org num));现在Via横向个数 = 本身个数 + num
  23.                 );end if
  24.             );end when
  25.             when(dir == "column"    ;当鼠标输入为修改Via横向个数时,以下操作和纵向类似
  26.                 if(member(via~>orient rotation) == nil then
  27.                     org = via~>cutColumns
  28.                     via~>cutColumns = apply('plus list(org num))
  29.                 else
  30.                     org = via~>cutRows
  31.                     via~>cutRows = apply('plus list(org num))
  32.                 );end if
  33.             );end when
  34.             bBox2=via~>bBox
  35.             if(num==-1 then  
  36.                 when(dir == "row"
  37.                     dy=yCoord(cadr(bBox1))-yCoord(cadr(bBox2))
  38.                     via~>layer1Enc = list(xCoord(enc1) yCoord(enc1)+dy)
  39.                     via~>layer2Enc = list(xCoord(enc2) yCoord(enc2)+dy)
  40.                 );end when
  41.                 when(dir == "column"
  42.                     dx=xCoord(cadr(bBox1))-xCoord(cadr(bBox2))
  43.                     via~>layer1Enc = list(xCoord(enc1)+dx yCoord(enc1))
  44.                     via~>layer2Enc = list(xCoord(enc2)+dx yCoord(enc2))
  45.                 );end when
  46.             )
  47.         );end foreach()
  48.     )
  49. );end procedure


复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2025-7-30 18:57 , Processed in 0.017887 second(s), 7 queries , Gzip On, Redis On.

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