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

EDABOSS电子论坛

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

[资料共享] 检查器件名称方向的skill源码

[复制链接]

13

主题

0

回帖

69

E币

技术员

Rank: 2

积分
26
发表于 2017-12-15 22:34:31 | 显示全部楼层 |阅读模式

  1. axlCmdRegister( "Check_Dir" 'Check_Refdes_Direction)

  2. defun( Check_Refdes_Direction ()

  3.         axlVisibleDesign(nil)
  4.         axlVisibleLayer( "BOARD GEOMETRY/OUTLINE" t )
  5.         axlVisibleLayer( "PIN/TOP" t )
  6.         axlVisibleLayer( "PIN/BOTTOM" t )
  7.         axlVisibleLayer( "REF DES/SILKSCREEN_TOP" t )
  8.         axlVisibleLayer( "REF DES/SILKSCREEN_BOTTOM" t )
  9.         axlVisibleLayer( "PACKAGE GEOMETRY/SILKSCREEN_TOP" t )
  10.         axlVisibleLayer( "PACKAGE GEOMETRY/SILKSCREEN_BOTTOM" t )

  11.         logfile = axlDMOpenLog("dir_error.log")
  12.         fprintf(logfile "#Check the direction errores of refdes . \n\n")
  13.         fprintf(logfile "REF_DES  COORDIRATION\n")
  14.         
  15.         setq(allsym axlDBGetDesign()->symbols)
  16.         axlDehighlightObject(allsym)
  17.         dir = nil        
  18.         dircnt = 0
  19. ;        noref = nil
  20. ;        norefcnt = 0
  21.         foreach(symbol allsym         ;n=0 ++n symbol=nthelem(n allsym)
  22.                 text= axlDBGetAttachedText(symbol)
  23.                 txt = nil
  24.                 foreach(find text
  25.                         if(find->layer == "REF DES/SILKSCREEN_TOP" ||
  26.                         find->layer == "REF DES/SILKSCREEN_BOTTOM" then                                                                        
  27.                                 txt = find                        
  28.                         )                                                               
  29.                 )
  30. /*                if(txt == nil && symbol->refdes != nil then
  31.                         axlHighlightObject(symbol)
  32.                         noref = cons(symbol->refdes noref)
  33.                         ++norefcnt
  34.                 )
  35. */                if(txt != nil && txt->text != nil then
  36.                         axlMsgPut("Processing package : %s " txt->text)        
  37.                         if(txt->layer == "REF DES/SILKSCREEN_TOP" then
  38.                                 if(abs(txt->rotation - 0.0) < 5.0 || abs(txt->rotation - 90.0) < 5.0 ||
  39.                                 abs(txt->rotation - 360.0) < 5.0 then
  40.                                 x = 0
  41.                                 else
  42.                                         axlHighlightObject(symbol)
  43.                                         ;dir = cons(symbol->refdes dir)
  44.                                         fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
  45.                                         ++dircnt
  46.                                 )
  47.                         else if(txt->layer == "REF DES/SILKSCREEN_BOTTOM" then
  48.                                 if(abs(txt->rotation - 0.0) < 5.0 || abs(txt->rotation - 90.0) < 5.0 ||
  49.                                 abs(txt->rotation - 360.0) < 5.0 then
  50.                                 x = 0
  51.                                 else
  52.                                         axlHighlightObject(symbol)
  53.                                         ;dir = cons(symbol->refdes dir)
  54.                                         fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
  55.                                         ++dircnt
  56.                                 )
  57.                                 )                        
  58.                         )
  59.                         if(txt->isMirrored == t then
  60.                                 if(txt->parent->isMirrored != t then                                
  61.                                         axlHighlightObject(symbol)
  62.                                         ;dir = cons(symbol->refdes dir)
  63.                                         fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
  64.                                         ++dircnt
  65.                                 )
  66.                         else
  67.                                 if(txt->parent->isMirrored == t then
  68.                                         axlHighlightObject(symbol)
  69.                                         ;dir = cons(symbol->refdes dir)
  70.                                         fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
  71.                                         ++dircnt                        
  72.                                 )                                
  73.                         )
  74.                 );if_end
  75.                
  76.         );foreach-end

  77.         fprintf(logfile "\nTotal direction error of refdes: %d\n" dircnt)
  78.         axlDMClose(logfile)
  79.         
  80.         axlMsgPut("Total direction error of refdes: %d\n" dircnt)      
  81.         axlMsgPut("Refdes direction error , please view logfile.")
  82. ;        axlMsgPut("Total of components without refdes is : %d %L .\nDone" norefcnt noref)        
  83. );defun_end
复制代码


积分规则
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2023-12-2 17:46 , Processed in 0.039156 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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