Cadence Skill 论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 10258|回复: 14

检查器件名称方向的skill源码

[复制链接]
发表于 2016-8-29 11:34:41 | 显示全部楼层 |阅读模式


axlCmdRegister( "Check_Dir" 'Check_Refdes_Direction)

defun( Check_Refdes_Direction ()

        axlVisibleDesign(nil)
        axlVisibleLayer( "BOARD GEOMETRY/OUTLINE" t )
        axlVisibleLayer( "PIN/TOP" t )
        axlVisibleLayer( "PIN/BOTTOM" t )
        axlVisibleLayer( "REF DES/SILKSCREEN_TOP" t )
        axlVisibleLayer( "REF DES/SILKSCREEN_BOTTOM" t )
        axlVisibleLayer( "PACKAGE GEOMETRY/SILKSCREEN_TOP" t )
        axlVisibleLayer( "PACKAGE GEOMETRY/SILKSCREEN_BOTTOM" t )

        logfile = axlDMOpenLog("dir_error.log")
        fprintf(logfile "#Check the direction errores of refdes . \n\n")
        fprintf(logfile "REF_DES  COORDIRATION\n")
       
        setq(allsym axlDBGetDesign()->symbols)
        axlDehighlightObject(allsym)
        dir = nil       
        dircnt = 0
;        noref = nil
;        norefcnt = 0
        foreach(symbol allsym         ;n=0 ++n symbol=nthelem(n allsym)
                text= axlDBGetAttachedText(symbol)
                txt = nil
                foreach(find text
                        if(find->layer == "REF DES/SILKSCREEN_TOP" ||
                        find->layer == "REF DES/SILKSCREEN_BOTTOM" then                                                                        
                                txt = find                       
                        )                                                               
                )
/*                if(txt == nil && symbol->refdes != nil then
                        axlHighlightObject(symbol)
                        noref = cons(symbol->refdes noref)
                        ++norefcnt
                )
*/                if(txt != nil && txt->text != nil then
                        axlMsgPut("Processing package : %s " txt->text)        
                        if(txt->layer == "REF DES/SILKSCREEN_TOP" then
                                if(abs(txt->rotation - 0.0) < 5.0 || abs(txt->rotation - 90.0) < 5.0 ||
                                abs(txt->rotation - 360.0) < 5.0 then
                                x = 0
                                else
                                        axlHighlightObject(symbol)
                                        ;dir = cons(symbol->refdes dir)
                                        fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
                                        ++dircnt
                                )
                        else if(txt->layer == "REF DES/SILKSCREEN_BOTTOM" then
                                if(abs(txt->rotation - 0.0) < 5.0 || abs(txt->rotation - 90.0) < 5.0 ||
                                abs(txt->rotation - 360.0) < 5.0 then
                                x = 0
                                else
                                        axlHighlightObject(symbol)
                                        ;dir = cons(symbol->refdes dir)
                                        fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
                                        ++dircnt
                                )
                                )                       
                        )
                        if(txt->isMirrored == t then
                                if(txt->parent->isMirrored != t then                               
                                        axlHighlightObject(symbol)
                                        ;dir = cons(symbol->refdes dir)
                                        fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
                                        ++dircnt
                                )
                        else
                                if(txt->parent->isMirrored == t then
                                        axlHighlightObject(symbol)
                                        ;dir = cons(symbol->refdes dir)
                                        fprintf(logfile "%-8s %L\n" txt->text symbol->xy)
                                        ++dircnt                       
                                )                               
                        )
                );if_end
               
        );foreach-end

        fprintf(logfile "\nTotal direction error of refdes: %d\n" dircnt)
        axlDMClose(logfile)
       
        axlMsgPut("Total direction error of refdes: %d\n" dircnt)      
        axlMsgPut("Refdes direction error , please view logfile.")
;        axlMsgPut("Total of components without refdes is : %d %L .\nDone" norefcnt noref)        
);defun_end
发表于 2016-8-31 14:29:54 | 显示全部楼层
我有这个skill 哈哈
发表于 2016-8-31 14:29:59 | 显示全部楼层
我有这个skill 哈哈
发表于 2016-8-31 14:30:01 | 显示全部楼层
我有这个skill 哈哈
发表于 2016-9-1 13:29:01 | 显示全部楼层
怎么检查啊  ?
发表于 2016-9-1 13:29:57 | 显示全部楼层
大师学习了
发表于 2016-9-5 17:03:57 | 显示全部楼层
我有这个skill 哈哈
发表于 2016-10-28 15:15:46 | 显示全部楼层
感谢分享,学习了
发表于 2016-11-8 15:15:42 | 显示全部楼层
看不太明白,有解释语句就好了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-3-29 00:31 , Processed in 0.137221 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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