EDA365电子工程师网

标题: 有沒有像PADS那樣快速定位到器件放大並高亮器件的功能呢 [打印本页]

作者: szc1983    时间: 2011-5-31 00:34
标题: 有沒有像PADS那樣快速定位到器件放大並高亮器件的功能呢
可以考慮用ctrl+F做快捷鍵

作者: szc1983    时间: 2011-5-31 00:35
allegro找個器件找個網絡都要費老大勁,唉
作者: szc1983    时间: 2011-5-31 09:36
找到個源程序,這個程序不錯有點不足就是器件放大的不夠大
不能夠手工輸入器件名稱查找只能從列表定位
還有就是不能按網絡名搜索
沒有高亮選項


; ##########################################################################
;
;                       Find Components from List
;
;   This routine will open a form which displays all currently placed
;   components. When the user selects a ref des from the list the component
;   is highlighted and the working window is resized to the components
;   bounding box with 500 drawing units (500 mils) on each side. The "Filter"
;   in the form allows the user to select only components beginning with the
;   specified character. The "REFRESH LIST" button updates the list with the
;   current data taking any filter setting into account.

;   To run the routine within Allegro type "find component".

;   Written by David J. Scheuring
;   Sr. Applications Eng. Cadence Design Systems
;   May 31, 1995

;   Rev A
;   March, 19,2000
;   Adjusted behavior of Refresh List button and Ref Des Filter

;   Rev B
;   June 23,2004
;   Adjusted behavior of Refresh List button and Ref Des Filter for use in 15.x release
;   Changes
;   June 24,2004 - Included changes from Charlie Davies (Harris GCSD)
;                 - modified window parameters to work with any DB units.


axlCmdRegister( "find component" `Find_Component_Routine ?cmdType "interactive")

; ########################
; Set the global variables
; ########################

Ref_Des_Filter="*"
Comp_List=nil
Placed_List=nil

(defun Find_Component_Routine ()
axlDBRefreshId(axlDBGetDesign())
axlClearSelSet()

; #################
; Declare variables
; #################
(let (Find_Component_Form Command)

  ; ###############
  ; Clear variables
  ; ###############
  Find_Component_Form=nil
  Command=nil

  ; ####################################
  ; Build the placed component list form
  ; ####################################
  Find_Component_Form=outfile("Find_Component_Form.form" "w")
  fprintf(Find_Component_Form "FILE_TYPE=FORM_DEFN VERSION=2\n")
  fprintf(Find_Component_Form "FORM\n")
  fprintf(Find_Component_Form "FIXED\n")
  fprintf(Find_Component_Form "PORT 25 20\n")
  fprintf(Find_Component_Form "HEADER \"Find Component\"\n")
  fprintf(Find_Component_Form "TILE\n")
  fprintf(Find_Component_Form "TEXT \"COMPONENTS LIST\"\n")
  fprintf(Find_Component_Form "TLOC 4 0\n")
  fprintf(Find_Component_Form "ENDTEXT\n")
  fprintf(Find_Component_Form "FIELD Placed_List\n")
  fprintf(Find_Component_Form "FLOC 2 2\n")
  fprintf(Find_Component_Form "LIST \"\" 21 10\n")
  fprintf(Find_Component_Form "ENDFIELD\n")
  fprintf(Find_Component_Form "TEXT \"Current Ref Des\"\n")
  fprintf(Find_Component_Form "TLOC 2 25\n")
  fprintf(Find_Component_Form "ENDTEXT\n")
  fprintf(Find_Component_Form "FIELD Current_Ref_Des\n")
  fprintf(Find_Component_Form "FLOC 2 27\n")
  fprintf(Find_Component_Form "STRFILLIN 16 10\n")
  fprintf(Find_Component_Form "ENDFIELD\n")
  fprintf(Find_Component_Form "TEXT \"Filter:\"\n")
  fprintf(Find_Component_Form "TLOC 2 30\n")
  fprintf(Find_Component_Form "ENDTEXT\n")
  fprintf(Find_Component_Form "FIELD Ref_Des_Filter\n")
  fprintf(Find_Component_Form "FLOC 10 30\n")
  fprintf(Find_Component_Form "STRFILLIN 5 10\n")
  fprintf(Find_Component_Form "ENDFIELD\n")
  fprintf(Find_Component_Form "FIELD Refresh_List\n")
  fprintf(Find_Component_Form "FLOC 2 33\n")
  fprintf(Find_Component_Form "MENUBUTTON \"REFRESH LIST\" 15 3\n")
  fprintf(Find_Component_Form "ENDFIELD\n")
  fprintf(Find_Component_Form "FIELD done\n")
  fprintf(Find_Component_Form "FLOC 2 36\n")
  fprintf(Find_Component_Form "MENUBUTTON \"Done\" 6 3\n")
  fprintf(Find_Component_Form "ENDFIELD\n")
  fprintf(Find_Component_Form "ENDTILE\n")
  fprintf(Find_Component_Form "ENDFORM\n")
  close(Find_Component_Form)

  ; ##################################
  ; Generate list of placed components
  ; ##################################
  axlSetFindFilter(?enabled '(noall components) ?onButtons '(noall components))
  Comp_List=axlGetSelSet(axlAddSelectAll())
(foreach Item Comp_List
   (if Item->symbol!=nil then
    Placed_List=cons(Item->name Placed_List)
   ); if Item->symbol!=nil
  ); end foreach Item Comp_List

  ; #################################
  ; Define the place list form action
  ; #################################
  (defun Find_Component_Form_Action_Routine (Find_Component_Form)
   (case Find_Component_Form->curField
    ("Refresh_List"
    Placed_List=nil
    axlDBRefreshId(axlDBGetDesign())
    axlClearSelSet()
    axlSetFindFilter(?enabled '(noall components) ?onButtons '(noall components))
    Comp_List=nil
    Comp_List_Unfiltered=nil
    (if Ref_Des_Filter == "*" then
     Comp_List=axlGetSelSet(axlAddSelectAll()) else
     Comp_List_Unfiltered=axlGetSelSet(axlAddSelectAll())
     (foreach Item Comp_List_Unfiltered
      (if getchar(Item->name 1) == getchar(Ref_Des_Filter 1) then
       Comp_List=cons(Item Comp_List)
      ); end if
     ); end foreach
    ); end if
    (foreach Item Comp_List
     (if Item->symbol!=nil then
      Placed_List=cons(Item->name Placed_List)
     ); end if Item->symbol!=nil
    ); end foreach Item Comp_List
    (if Placed_List==nil then
     axlFormListDeleteAll(Find_Component_Form "Placed_List")
     axlFormSetField(Find_Component_Form "Placed_List" "No Match")
     axlFormSetField(Find_Component_Form "Ref_Des_Filter" Ref_Des_Filter)
     axlFormDisplay(Find_Component_Form)
     axlUIWPrint(Find_Component_Form "No Match")
     else
     axlFormListDeleteAll(Find_Component_Form "Placed_List")
     Placed_List=sort(Placed_List nil)
      axlFormSetField(Find_Component_Form "Placed_List" Placed_List)
      axlFormSetField(Find_Component_Form "Ref_Des_Filter" Ref_Des_Filter)
      axlFormDisplay(Find_Component_Form)
      axlUIWPrint(Find_Component_Form "Select Component")
    ); end if Placed_List==nil
   ); end Refresh_List
    ("Ref_Des_Filter"
     (if Find_Component_Form->curValue == "" then
      Ref_Des_Filter="*" else
      Ref_Des_Filter=upperCase(Find_Component_Form->curValue)
      t
     ); end if
    ); end "Ref_Des_Filter"
    ("done"
     Placed_List=nil
     (axlFormClose Find_Component_Form)
     (axlCancelEnterFun)
     axlClearSelSet()
     axlFlushDisplay()
     axlShell("redisplay")
    ); end "done"
    ("Placed_List"
     axlSetFindFilter(?enabled '(components) ?onButtons '(components))
     Component=axlGetSelSet(axlSingleSelectName("COMPONENT" strcat(Find_Component_Form->curValue)))
     axlHighlightObject(Component)
     window_buffer = axlMKSConvert(500 "MILS")
     Lower_X=car(car(car(Component)->symbol->bBox))-window_buffer
     Lower_Y=car(cdr(car(car(Component)->symbol->bBox)))-window_buffer
     Upper_X=car(car(cdr(car(Component)->symbol->bBox)))+window_buffer
     Upper_Y=car(cdr(car(cdr(car(Component)->symbol->bBox))))+window_buffer
     Command=sprintf(dummy "window points;x %f y %f;x %f y %f" Lower_X Lower_Y Upper_X Upper_Y)
     axlFormSetField(Find_Component_Form "Current_Ref_Des" Find_Component_Form->curValue)
     axlShell(Command)
     t
    ); end "Placed_List"
   ); end case
  ); end defun Find_Component_Form_Action_Routine

  ; #####################
  ; Display the form/list
  ; #####################
   Find_Component_Form=axlFormCreate( (gensym) "Find_Component_Form.form" '(e outer) 'Find_Component_Form_Action_Routine t)
   (if Placed_List==nil then
    axlFormSetField(Find_Component_Form "Placed_List" "No Placed Comps")
    axlFormSetField(Find_Component_Form "Ref_Des_Filter" Ref_Des_Filter)
    axlFormDisplay(Find_Component_Form)
    axlUIWPrint(Find_Component_Form "No Placed Comps")
    else
    Find_Component_Form=axlFormCreate( (gensym) "Find_Component_Form.form" '(e outer) 'Find_Component_Form_Action_Routine t)
    Placed_List=sort(Placed_List nil)
    (foreach Ref_Des Placed_List
     axlFormSetField(Find_Component_Form "Placed_List" Ref_Des)
     axlFormSetField(Find_Component_Form "Ref_Des_Filter" Ref_Des_Filter)
     axlFormDisplay(Find_Component_Form)
     axlUIWPrint(Find_Component_Form "Select Component")
    ); end foreach Ref_Des Placed_Lis
   ); end if Placed_List==nil
); end let
); end defun Find_Component_Routine

作者: lidin    时间: 2011-6-1 17:35
呵呵,早就有这样的SKILL了,可以输入零件序号搜到后放大,还可以搜索NETS
作者: lidin    时间: 2011-6-1 17:38
回复 szc1983 的帖子

[attach]40002[/attach]
作者: cxyjoe    时间: 2011-6-1 18:17
这个方面还是Pads 做的好

作者: laikelang    时间: 2011-6-1 19:14
这个功能我有个程序,不过是加密的,没源码。不好共享。
[attach]40005[/attach]

作者: deargds    时间: 2011-6-1 20:58
本帖最后由 deargds 于 2011-6-6 21:00 编辑

回复 szc1983 的帖子

;之前发过一段代码,现修改成CTRL+FaxlSetAlias( "~F" "skill x_search_net_comp")
defun( x_search_net_comp ()
let((db)
    when((obj = axlUIPrompt("\307\353\312\344\310\353\322\252\262\351\325\322\265\304\301\343\274\376\303\373\273\362\315\370\302\347\303\373:" "" ))
        db = axlDBFindByName('net obj)
        unless(axlIsDBIDType(db) db = axlDBFindByName('refdes obj))
        when(axlIsDBIDType(db)
            axlHighlightObject(db)
            axlZoomToDbid(db , t)
            axlShell("zoom out")
        )
    )
)
)
;www.eda365.com



[attach]40006[/attach]

作者: szc1983    时间: 2011-6-2 00:04
lidin 发表于 2011-6-1 17:38
回复 szc1983 的帖子

这个skill叫啥名字啊
作者: 阿明wh    时间: 2011-6-2 06:03
感谢版主。这次找器件方便多了。
作者: lidin    时间: 2011-6-2 09:27
回复 szc1983 的帖子

search.il  收藏好多年了,发出来共享给大家 [attach]40012[/attach]
作者: lidin    时间: 2011-6-2 09:29
用法大家都知道把,在相关文件里添加解压后的名字,命令:s
作者: zrnjty    时间: 2011-7-4 16:45
感谢“lidin”
作者: longzhiming    时间: 2011-12-12 20:35
lidin 发表于 2011-6-2 09:27
回复 szc1983 的帖子

search.il  收藏好多年了,发出来共享给大家

谢谢,不过,新版allegro查找功能没问题,很快很好.
作者: eeliujm    时间: 2016-4-22 11:14
谢谢分享~
作者: wcjcn    时间: 2017-6-9 15:52
谢谢。。。。
作者: 小秋2013    时间: 2017-7-19 14:46
下载试试,谢谢分享
作者: 看海去不去    时间: 2017-7-20 09:53
设置快捷键,很方便




欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/) Powered by Discuz! X3.2