找回密码
 注册
关于网站域名变更的通知
查看: 1343|回复: 3
打印 上一主题 下一主题

【原创】【源码】图纸大小设置工具

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2022-10-1 11:38 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

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

x

allegro PCB图纸大小设置工具 ,半成品,有些问题未解决,功能未完善,目前空板时能设置,把源码码发出来,有能力的同学拿去继续开发,开发完记得分享下




SetBoard.rar (1.01 KB, 下载次数: 12)

  1. <div>
  2. </div><div><div class="blockcode"><blockquote>axlCmdRegister("SetBoard" 'SetBoard_Form_Pro)


  3. procedure(SetBoard_Form_Pro()
  4.                         SetBoardForm=axlFormCreate((gensym) "SetBoard.form" nil 'SetBoard_Form_Action t nil)
  5.                         axlFormDisplay(SetBoardForm)
  6.                 GetSetPro()       
  7. )

  8. procedure(SetBoard_Form_Action(SetBoardForm)
  9. case(SetBoardForm->cuRField
  10.                 ("GetSetButton"
  11.                         GetSetPro()       
  12.                 )               
  13.                 ("StandSetButton"
  14.                         DrawingSize_mm=list(`(1189 841) `(841 594) `(594 420) `(420 297) `(297 210) `(210 148) `(148 105))
  15.                         SelectSize = atoi(axlFormGetField(SetBoardForm "StandEnum"))                       
  16.                         ;extents = axlExtentDB('obstacle)
  17.                         ;extents = bBoxAdd(extents '((-5 -5) (297 210)))
  18.                         SetSizeWidth= nth(0 nth(SelectSize DrawingSize_mm))/du
  19.                         SetSizeHigh= nth(1 nth(SelectSize DrawingSize_mm))/du
  20.                         extents=list( list(-SetSizeWidth/2 -SetSizeHigh/2) list(SetSizeWidth/2 SetSizeHigh/2))
  21.                         axlDBChangeDesignExtents(extents)
  22.                        
  23.                         SetDrawingScriptCreate(-200 -200 2100 2200)
  24.                         ;axlDBChangeDesignExtents(list(`(-500 -500) `(2560 1440)))
  25.                         ;axlDBChangeDesignExtents(list(`(-500 -500) `(1920 1080)))
  26.                         ;axlDBChangeDesignExtents(list(`(-5 -5) `(10 10)))
  27.                 )
  28.                 ("SizeSetButton"
  29.                        
  30.                 )
  31.                 ("LocalSetButton"
  32.                         print("LocalSetButton!")               
  33.                 )               
  34.                 ("AllSetButton"
  35.                         AllSetPro()
  36.                 )
  37.         )
  38. )

  39. procedure(GetSetPro()
  40.         Drawingunit = axlGetParam("paramDesign")->units
  41.         case(Drawingunit
  42.                 ("mils"  DRUnit = 0.0254)
  43.                 ("millimeters" DRUnit = 1 )
  44.         )
  45.         print(DRUnit)       
  46.         axlFormSetField(SetBoardForm "DrawingHigh" DRUnit*axlGetParam("paramDesign")->height)
  47.         axlFormSetField(SetBoardForm "DrawingWidth" DRUnit*axlGetParam("paramDesign")->width)
  48.         axlFormSetField(SetBoardForm "LeftX" -DRUnit*nth(0 axlGetParam("paramDesign") ->xy))       
  49.         axlFormSetField(SetBoardForm "LeftY" -DRUnit*nth(1 axlGetParam("paramDesign") ->xy))       

  50. )

  51. procedure(AllSetPro()
  52.         DrawingHigh=axlFormGetField(SetBoardForm "DrawingHigh")
  53.         DrawingWidth=axlFormGetField(SetBoardForm "DrawingWidth")
  54.         LeftX=-axlFormGetField(SetBoardForm "LeftX")
  55.         LeftY=-axlFormGetField(SetBoardForm "LeftY")       
  56.         SetDrawingScriptCreate(LeftX LeftY DrawingWidth DrawingHigh)       
  57. )

  58. procedure(SetDrawingScriptCreate(Draw_X Draw_Y SizeWidth SizeHigh)
  59.                 DRScriptFile = axlTempFile()
  60.                 DRScrPort = outfile(DRScriptFile "w")
  61.                 fprintf(DRScrPort "scriptmode +i +n\n")
  62.                 fprintf(DRScrPort "version 16.6\n")
  63.                 fprintf(DRScrPort "setwindow pcb\n")
  64.                 fprintf(DRScrPort "trapsize 24081\n")
  65.                 fprintf(DRScrPort "generaledit\n")
  66.                 fprintf(DRScrPort "prmed \n")
  67.                 fprintf(DRScrPort "setwindow form.prmedit\n")
  68.                 fprintf(DRScrPort "FORM prmedit x %n \n" Draw_X)
  69.                 fprintf(DRScrPort "FORM prmedit y %n \n" Draw_Y)
  70.                 fprintf(DRScrPort "FORM prmedit width %n \n" SizeWidth)
  71.                 fprintf(DRScrPort "FORM prmedit height %n \n" SizeHigh)
  72.                 fprintf(DRScrPort "FORM prmedit done  \n")
  73.                 fprintf(DRScrPort "setwindow pcb\n")
  74.                 fprintf(DRScrPort "trapsize 24081\n")
  75.                 fprintf(DRScrPort "generaledit \n")
  76.                 close(DRScrPort)
  77.                 sprintf(runScript,"replay %s",DRScriptFile)
  78.                 axlShell(strcat("replay " DRScriptFile))
  79.                 deleteFile(DRScriptFile)
  80. );end procedure


复制代码












  • TA的每日心情
    开心
    2024-3-26 15:26
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    2#
    发表于 2022-10-5 13:41 | 只看该作者
    下載,這個不錯,方便

    点评

    怎么使用啊 是在ilinit里面添加load("setboard")吗  详情 回复 发表于 2024-5-14 09:28
  • TA的每日心情
    擦汗
    2023-8-28 15:01
  • 签到天数: 1 天

    [LV.1]初来乍到

    3#
    发表于 2024-5-14 09:28 | 只看该作者
    Cadence_skill 发表于 2022-10-5 13:41
    下載,這個不錯,方便

    怎么使用啊
    是在ilinit里面添加load("setboard")吗
  • TA的每日心情
    开心
    2024-5-9 15:21
  • 签到天数: 2 天

    [LV.1]初来乍到

    4#
    发表于 2024-5-14 10:00 | 只看该作者
    :):):):):):)
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

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

    EDA365公众号

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

    GMT+8, 2025-11-22 03:37 , Processed in 0.171875 second(s), 28 queries , Gzip On.

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

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

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