zoujunlin的个人空间 https://blog.eetop.cn/670195 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

enhanced_ruler.il

已有 1404 次阅读| 2017-5-25 22:12 |个人分类:script|系统分类:芯片设计

;File   :       enhanced_ruler.il
;Author :       ZouJunlin
;Date   :       2017/05/25
;Description:   create a perpendicular ruler at the middle of current ruler
;step 1 :       record the begin point when press the bindkey
;step 2 :       create a normal ruler and record the end point
;step 3 :       create the perpendicular ruler at the middle

procedure(enhanced_ruler()
 prog( (cv begin_point end_point x1 y1 x2 y2 delta_x delta_y mid_x mid_y)
  cv = geGetEditCellView()
;step 1 :       record the begin point when press the bindkey
  infix_origin = envGetVal("ui" "infix")
  envSetVal("ui" "infix" 'boolean t) ;set infix to get the begin point
  modalCommands_origin = envGetVal("layout" "modalCommands")
  envSetVal("layout" "modalCommands" 'boolean nil)
; set no repeat command so that this skill will excute immediatlyafter create ruler finished.
; aSRP means autoSetRefPoint for short
  aSRP_origin = envGetVal("layout" "autoSetRefPoint")
  envSetVal("layout" "autoSetRefPoint" 'boolean t) ; set aSRP to get the end point

;  begin_point = hiGetDbuPoint(hiGetCurrentWindow())
;  x1 = car(begin_point)/1000   ; dbu per unit maybe 1000 or 2000 according to the techfile definition
;  y1 = cadr(begin_point)/1000  ; dbu per unit maybe 1000 or 2000 according to the techfile definition
  begin_point = hiGetPoint(hiGetCurrentWindow())
  x1 =  car(begin_point)
  y1 = cadr(begin_point)
;step 2 :       create a normal ruler and record the end point
; press F3 when create ruler to disable snap function
  leHiCreateRuler()
  end_point = leGetRefPoint(cv)
;step 3 :       create the perpendicular ruler at the middle
  x2 =  car(end_point)
  y2 = cadr(end_point)
  delta_x = x2 - x1
  delta_y = y2 - y1
  mid_x = (x1 + x2)/2
  mid_y = (y1 + y2)/2
  rulerLength = 1
  if(delta_x == 0 then
        leCreateRuler(cv list(mid_x:mid_y mid_x-rulerLength:mid_y))
        leCreateRuler(cv list(mid_x:mid_y mid_x+rulerLength:mid_y))
  );end if
  if(delta_y == 0 then
        leCreateRuler(cv list(mid_x:mid_y mid_x:mid_y+rulerLength))
        leCreateRuler(cv list(mid_x:mid_y mid_x:mid_y-rulerLength))
  );end if
  if(delta_x * delta_y > 0 then
        leCreateRuler(cv list(mid_x:mid_y mid_x-rulerLength:mid_y+rulerLength))
        leCreateRuler(cv list(mid_x:mid_y mid_x+rulerLength:mid_y-rulerLength))
  );end if
  if(delta_x * delta_y < 0 then
        leCreateRuler(cv list(mid_x:mid_y mid_x-rulerLength:mid_y-rulerLength))
        leCreateRuler(cv list(mid_x:mid_y mid_x+rulerLength:mid_y+rulerLength))
  );end if

;restore envioronment value
  envSetVal("ui" "infix" 'boolean infix_origin)
  envSetVal("layout" "modalCommands" 'boolean modalCommands_origin)
  envSetVal("layout" "autoSetRefPoint" 'boolean aSRP_origin)
 );end prog
);end procedure

printf("enhanced_ruler.il loaded\n")

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 9

    粉丝
  • 0

    好友
  • 3

    获赞
  • 3

    评论
  • 987

    访问数
关闭

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

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

GMT+8, 2024-11-5 16:17 , Processed in 0.015295 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部