找回密码
 注册
查看: 599|回复: 7
打印 上一主题 下一主题

Cline2Shape的SKILL小工具

[复制链接]
  • TA的每日心情

    2024-2-27 15:43
  • 签到天数: 12 天

    [LV.3]偶尔看看II

    跳转到指定楼层
    1#
     楼主| 发表于 2023-11-28 09:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

    EDA365欢迎您登录!

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

    x
    这个skill功能是可以将Cline转换成相应层的Shape。将下面文本保存.il格式即可。调用字符cl2s
    ;============================================================================
    ; Copyright Tait Electronics Ltd., 2005. All rights reserved.
    ;
    ; Program Name: cl2s.il
    ;
    ; Author:        Dave Elder, PCB Design Manager,
    ;                Tait Electronics, Christchurch, New Zealand
    ;                dave.elder@tait.co.nz
    ;
    ; Tested on:        allegro 15.2
    ;
    ; Purpose:        Convert a cline to a shape.
    ;
    ; Usage:        To run the routine within Allegro type: "cl2s".
    ;
    ; History:
    ;
    ;  1.3        21-Mar-05 DE        Release to Allegro Forum
    ;
    ;============================================================================


    axlCmdRegister("cl2s" 'CL2S_clineToShape ?cmdType "interactive")
    defun( CL2S_clineToShape ()
    let((mark, popupAllActive, popupGrayOops, oldSetData, endType, pt, clines, cline, layer, netName, parent, polys, (oopsCount 0), n)
      mark = axlDBTransactionStart()
      popupAllActive = axlUIPopupDefine(nil '(
        ("Done" "axlDBTransactionCommit(mark), axlFinishEnteRFun()")
        ("Oops" "axlDBTransactionOops(mark), when(zerop(--oopsCount), axlUIPopupSet(popupGrayOops))")
        ("Cancel" "axlDBTransactionRollback(mark), axlCancelEnterFun()")
        ("MENU_SEPARATOR", nil)
        ("Toggle End Cap Type"
          "endType = nthelem( n++ list( 'SQUARE, 'ROUND, 'OCTAGON))
          printf(\"Select cline (End Cap Type will be %s)\\n\", endType)
          if( n > 3, n = 1)"
        )
      ))
      axlUICmdPopupSet(popupAllActive)
      popupGrayOops = axlUIPopupDefine(nil, '(
        ("Done" "axlDBTransactionCommit(mark), axlFinishEnterFun()")
        ("Cancel" "axlDBTransactionRollback(mark), axlCancelEnterFun()")
        ("Toggle End Cap Type"
          "endType = nthelem( n++ list( 'SQUARE, 'ROUND, 'OCTAGON))
          printf(\"Select cline (End Cap Type will be %s)\\n\", endType)
          if( n > 3, n = 1)"
        )
      ))
      axlUIPopupSet(popupGrayOops)
      endType = 'OCTAGON
      n = 1
      oldSetData = list(axlGetSelSet(), axlGetFindFilter(nil), axlGetFindFilter(t))
      axlSetFindFilter(?enabled list("noall", "CLINES"), ?onButtons list("noall", "CLINES"))
      while(pt = axlEnterPoint(?prompts sprintf(nil, "Select cline (End Cap Type will be %s)", endType))
        axlClearSelSet()
        while(axlAddSelectPoint(pt), t); necessary to add all objects at point
        clines = axlGetSelSet()
        caseq(length(clines)
          (0, axlUIWPrint(nil, 'error, "No cline Here"))
          (1
            cline = car(clines), layer = cline ->layer, netName = cline ->net ->name, parent = cline ->parent
            polys = axlPolyFromDB(cline ?endCapType endType)
            if(polys then
              axlDBTransactionMark(mark), axlUIPopupSet(popupAllActive), oopsCount++
              axlClearSelSet(); Require for Allegro transaction bug that does not clear the find bit (Courtesy fxf).
              axlDeleteObject(cline)
              foreach(poly, polys, axlDBCreateShape(poly, t, layer, netName, and(parent ->objType, parent)))
             else axlUIWPrint(nil, 'error, "Sorry. Could not convert this cline.")
            )
          )
          (t, axlUIWPrint(nil, 'error, "Multiple clines Here. Pick again"))
        ); caseq
      ); while
      axlSetFindFilter(?enabled cons("noall", cadr(oldSetData)) ?onButtons cons("noall", caddr(oldSetData)))
      axlSingleSelectObject(car(oldSetData))
      axlDBTransactionCommit(mark)
      axlFinishEnterFun()
    ))

    该用户从未签到

    2#
    发表于 2023-11-28 19:40 | 只看该作者
    很实用的小工具
  • TA的每日心情

    2021-1-21 15:57
  • 签到天数: 121 天

    [LV.7]常住居民III

    3#
    发表于 2023-11-30 21:19 | 只看该作者
    学习学习  谢谢分享
  • TA的每日心情
    开心
    2024-3-28 15:16
  • 签到天数: 32 天

    [LV.5]常住居民I

    4#
    发表于 2024-1-9 15:04 | 只看该作者
    6666666666
  • TA的每日心情
    奋斗
    2025-4-23 15:54
  • 签到天数: 170 天

    [LV.7]常住居民III

    5#
    发表于 2024-1-11 14:58 | 只看该作者
    学习学习,谢谢分享
  • TA的每日心情
    开心
    2024-8-26 15:26
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    6#
    发表于 2024-8-15 14:51 | 只看该作者
    666666666666
  • TA的每日心情

    2024-12-26 15:10
  • 签到天数: 5 天

    [LV.2]偶尔看看I

    7#
    发表于 2024-8-15 15:20 | 只看该作者
    +11111111111111111
  • TA的每日心情

    2024-8-2 15:34
  • 签到天数: 6 天

    [LV.2]偶尔看看I

    8#
    发表于 2025-1-21 18:44 | 只看该作者
    感谢分享           
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-5-31 18:00 , Processed in 0.078125 second(s), 23 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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