请选择 进入手机版 | 继续访问电脑版

EDABOSS电子论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1131|回复: 6

[转帖] via center代码分享

[复制链接]

24

主题

0

回帖

189

E币

技术员

Rank: 2

积分
48
发表于 2017-12-16 16:12:37 | 显示全部楼层 |阅读模式
  1. /****************************************************/
  2. /*               Title :  Via Center                                */
  3. /*     Execute Command :  via_center                                */
  4. /*              Author :  Vivien Luo                */
  5. /*       Creation Date :  2013-07-13                */
  6. /*       Creation Date :                                          */
  7. /****************************************************/

  8. axlCmdRegister("via_center" 'via_center ?cmdType "interactive"
  9.                                  ?doneCmd 'via_center_done ?cancelCmd 'via_center_Cancel)

  10. procedure(via_center()
  11. notdone = t
  12. axlUIWPrint(nil "Via Center Set V1.0")
  13. axlUIWPrint(nil "Written by VivienLuo - Email:admin@allegro-skill.com")
  14. while(notdone
  15.         FirstPin = nil
  16.         SecondPin = nil
  17.         axlClearSelSet()
  18.         axlSetFindFilter(?enabled list("noall" "pins") ?onButtons list("noall" "pins"))
  19.         axlUIWPrint(nil "Please Select First Pin.....")
  20.         axlSingleSelectPoint()
  21.         FirstPin = car(axlGetSelSet())
  22.         axlClearSelSet()
  23.         axlHighlightObject(FirstPin)
  24.         axlSetFindFilter(?enabled list("noall" "pins") ?onButtons list("noall" "pins"))
  25.         axlUIWPrint(nil "Please Select Second Pin.....")
  26.         axlSingleSelectPoint()
  27.         SecondPin = car(axlGetSelSet())
  28.         axlClearSelSet()
  29.         axlHighlightObject(SecondPin)
  30.         when(FirstPin != nil && SecondPin != nil
  31.                 centerPoint = (xCoord(FirstPin->xy) + xCoord(SecondPin->xy))/2 : (yCoord(FirstPin->xy) + yCoord(SecondPin->xy))/2
  32.                 axlClearSelSet()
  33.                 axlSetFindFilter(?enabled list("noall" "vias") ?onButtons list("noall" "vias"))
  34.                 axlUIWPrint(nil "Please Select Via...")
  35.                 axlSingleSelectPoint()
  36.                 selVia = car(axlGetSelSet())
  37.                 if(selVia
  38.                         then
  39.                                 axlDBCreateVia(selVia->name centerPoint)
  40.                         else
  41.                                 axlUIWPrint(nil "No via selected....")
  42.                 )
  43.         );end when
  44.         axlDehighlightObject(FirstPin)
  45.         axlDehighlightObject(SecondPin))
  46. );end procedure

  47. procedure(via_center_done()
  48.                 notdone = nil
  49.                 axlFinishEnterFun()
  50.                 axlUIWPrint(nil "- Done -")
  51. )
  52. procedure(via_center_Cancel()
  53.                 notdone = nil
  54.                 axlCancelEnterFun()
  55.                 axlUIWPrint(nil "- Cancel -")
  56. )
复制代码


积分规则
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|EDABOSS电子论坛

GMT+8, 2024-3-29 23:57 , Processed in 0.038395 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表