Cadence Skill 论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
楼主: chuankay

[原创] 解决放置BGA去耦电容的烦恼

  [复制链接]
发表于 2023-9-1 17:31:30 | 显示全部楼层
运行命令后不能缩放界面,希望能改进一下
发表于 2024-1-23 09:40:03 | 显示全部楼层
; 帮版主修正了部分码源,怕有人有设自己的env快捷键 这边就移除了相关代码 (快捷键qp)
  1. axlCmdRegister("qp" 'Quick_place ?cmdType "general")

  2. procedure(Quick_place()

  3. formPath = "./snap.form"
  4. pform = outfile( formPath "w")

  5. fprintf(pform "FILE_TYPE=FORM_DEFN VERSION=2\n")
  6. fprintf(pform "FORM AUTOGREYTEXT\n")
  7. fprintf(pform "FIXED\n")
  8. fprintf(pform "PORT 35 10\n")
  9. fprintf(pform strcat("HEADER " """ "Quick Place" ""\n"))
  10. fprintf(pform "TILE\n")

  11. fprintf(pform "FIELD sel\n")
  12. fprintf(pform "FLOC 2 1\n")
  13. fprintf(pform strcat("MENUBUTTON " """ "1.Select Area" """ " 14 4\n"))
  14. fprintf(pform "ENDFIELD\n")

  15. fprintf(pform "FIELD pic\n")
  16. fprintf(pform "FLOC 18 1\n")
  17. fprintf(pform strcat("MENUBUTTON " """ "2.Place each" """ " 14 4\n"))
  18. fprintf(pform "ENDFIELD\n")

  19. ; fprintf(pform strcat("TEXT " """ "Snap to Pin: " ""\n"))
  20. ; fprintf(pform "TLOC 2 5\n")
  21. ; fprintf(pform "ENDTEXT\n")

  22. ; fprintf(pform strcat("TEXT " """ "Pick symbols:  " ""\n"))
  23. ; fprintf(pform "TLOC 2 7\n")
  24. ; fprintf(pform "ENDTEXT\n")

  25. fprintf(pform "ENDTILE\n")
  26. fprintf(pform "ENDFORM\n")  
  27. close(pform)

  28. snp = axlFormCreate( (gensym) "snap.form" '(e inner) 'snpCB t nil)
  29. axlFormDisplay(snp)
  30. deleteFile(formPath)

  31. formove = nil

  32. );defun

  33. defun(snpCB (snp)
  34.   func_list = axlGetFunckey(nil)
  35.   func_list = append( axlGetAlias(nil) func_list)
  36.   case(snp->curField
  37. ("sel" axlUIWPrint(snp "select box") SelectSym());case 1
  38. ("pic" if(!formove then

  39.    axlUIWPrint(snp "Select symbols by box")
  40.    
  41.     else
  42.        
  43.    if(I != 0 then
  44.    
  45.    box = axlLastPick(nil)
  46.    lastbox = axlWindowBoxGet()
  47.    
  48.    )
  49.    place_each()
  50.   );if
  51. );case 2
  52.   );case
  53.   
  54.    ;when(snp->doneState == 3
  55. ;axlSetFunckey("F11" "zoom in" t);吸附命令
  56. ;axlSetFunckey("F12" "zoom out" t);放置命令
  57.   ;);when

  58. );defun

  59. defun(SelectSym ()
  60.   I = 0;
  61.   axlClearSelSet()
  62.   axlSetFindFilter(?enabled list( "noall" "symbols" ) ?onButtons list( "noall" "symbols"))

  63.   ;axlSelect(?groupMode nil ?prompt nil)
  64.   axlAddSelectBox()
  65.   syms = axlGetSelSet()
  66.   formove = nil
  67.   foreach(db syms
  68. formove = append1(formove db->refdes)
  69.   );foreach
  70.   axlUIWPrint(snp sprintf(nil "%d symbols are ready for placing!" length(syms)))
  71. );defun


  72. defun(place_each ()
  73. prog(()
  74.   unless(formove return("select box first"))
  75.   if(I != 0 then
  76.   
  77.   box = axlLastPick(nil)
  78.   lastbox = axlWindowBoxGet()
  79.   
  80.   )
  81.   active = car(formove)
  82.   formove = cdr(formove)
  83.   if(active then
  84.    axlShell("move")
  85.    axlShell("setwindow form.mini")
  86.    axlShell("FORM mini rotate_point Sym Pin # ")
  87.    axlShell("setwindow form.find")
  88.    axlShell("FORM find name_type Symbol (or Pin)")
  89.    axlShell(sprintf(nil "FORM find find_name %s" active))
  90.    axlShell("setwindow pcb")
  91.    
  92.    when(I != 0  
  93.   axlWindowBoxSet(lastbox)  
  94.    );when  
  95.   
  96.    I++;
  97.    axlUIWPrint(snp sprintf(nil "%d/%d symbols statue!" I ,length(syms)))
  98.   );if
  99. );prog
  100. );  defun

  101. defun(snap ()
  102.   cursor = axlCursorGet(nil)
  103.   axlShell(sprintf(nil "prepopup %L" cursor))
  104.   axlShell("pop dyn_option_select 'Snap pick to@:@Pin'")
  105.   
  106. );defun
复制代码

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

本版积分规则

Archiver|手机版|网站地图|Cadence Skill 论坛 ( 蜀ICP备13024417号 )

GMT+8, 2024-4-27 21:20 , Processed in 0.132198 second(s), 13 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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