注册会员会员登录

当前位置:首页 > 脚本学习资料 > Csh

Genesis csh脚本常用语句参考

发布时间:2016-12-28 19:43:00 点击:

##程序的开头格式

#!c:/bin/csh

###########################################################

# Author: qhscript

# Date: 2012-08-29

# Revision: V01

# Purpose: this script is written for study

############################################################

 

##打开step

COM open_entity,job=$job,type=step,name=edit,iconic=no

AUX set_group,group=$COMANS

 

##改变单位

COM units,type=inch

COM units,type=mm

 

##得到genesis的用户名

COM get_user_name

set user_name = $COMANS

 

##得到当前的单位

COM get_units

set unit = $COMANS

 

##判断step是否存在

DO_INFO-t step -e $JOB/array -d EXISTS

if ($gEXISTS == "yes" ) then

    set step_name = array

endif

 

##判断层是否存在

DO_INFO-t LAYER -e $JOB/edit/drill -d EXISTS

if($gEXISTS == "yes") then

    setdrill_layers = drill

endif

 

##得到genesis的权限

COM get_user_priv

set priv = $COMANS

 

##判断是否打开了job

if (!$?JOB) then

    PAUSE You must be inside a job to runscript

    exit 0

endif

 

##得到日期时间

set date_time = `date +%y-%m-%d-%H:%M:%S `

 

##genesis层循环,删除带+++的层

DO_INFO-t matrix -e $job/matrix -d ROW

set i= 1

while($i<= $#gROWname)

      if ( $gROWname[$i] =~ *+++ ) then

           COM delete_layer,layer=$gROWname[$i]

      endif

      @ i++

end

 

##得到job的路径

set job_path = ` dbutil path jobs $job_name `

 

##判断目录是否存在

if($?GENESIS_TMP) then

     set tmp = $GENESIS_TMP

endif

 

##判断文件存在

if (-e $job_path/steps/panel/films/lyrlist ) then 

    rm -rf $job_path/steps/panel/films/lyrlist

endif   

 

##判断文件不存在

if (! -e $job_path/steps/panel/films/lyrlist ) then 

    touch$job_path/steps/panel/films/lyrlist

endif   

 

##影响层

COM clear_layers

COM affected_layer,mode=all,affected=no      

COM display_layer,name=drill,display=yes,number=1

COM work_layer,name=drill

 

###get the step

DO_INFO -t JOB -e $JOB -d STEPS_LIST

set i = 1

set step_list  = ( )

set have_pcb = no

while ( $i <= $#gSTEPS_LIST )

if ( $gSTEPS_LIST[$i] == pcb ) then

    setpcb_have = yes

endif         

@ i++

end

 

###get the signal layer

set signal_list = ( )

DO_INFO -t matrix -e $JOB/matrix -d ROW

set n = 1

while ( $n <= $#gROWcontext )

     if ( $gROWcontext[$n] == 'board' ) then

        if ( $gROWlayer_type[$n] == "signal" || $gROWlayer_type[$n] == "power_ground") then

              set signal_list = ( $signal_list $gROWname[$n] ) 

       endif

   endif

@ n++

end
    文章评论
    内容:
     
    惠州韦达软件技术服务有限公司:
    电话:15728891693 /18688300180 邮箱:2933839366@qq.com QQ: 2933839366 网址:www.qhscript.com