procvter

来自「proe5.0野火版下载(中文版免费下载)」· 代码 · 共 2,131 行 · 第 1/5 页

TXT
2,131
字号
   set igsdrw_80else   unset igsdrw_80   if ("$impfmt" == "drw" && `echo "$size_choice" | grep " $papersize " | wc -l` == 0) then      echo ""      echo "ERROR:  You must use the 7.0 option -ps option - currently $papersize -"      echo "        valid sizes are: $size_choice"      goto QUICK_EXIT   endifendif# 13.0 store -> saveif ("$trlnum" >= "730")  then   set saveit_cmd="#SAVE"else   set saveit_cmd="#STORE"endif##################################################################### reserved config optionsset tabookeys=`cat $my_cfgfile | awk '{print $1}'`set tabookeys=`echo $tabookeys | tr ' ' '|'`set tabookeys="$tabookeys|change_prop"# split dumpdir for pro/e if necc.set dd_abs="$dumpdir"set dd_rel=""set sep=""while (`echo "$dd_abs" | wc -c` > $wc_maxdirlen)   set tmp="$dd_abs:t"   if ("$dd_rel" != "") set sep="/"   set dd_rel="$tmp$sep$dd_rel"   set dd_abs="$dd_abs:h"end# Prefix trlbody for layout retrieval WITHOUT Pro/PROJECTecho '#PROJECT'                      > $trlprj echo '#CREATE'                      >> $trlprjecho "$dummy_proj_name"             >> $trlprj# Prefix trlbody for layout retrieval WITH Pro/PROJECTecho '#PROJECT'                      > $trlpprjecho '#OPEN'                        >> $trlpprjecho "#$dummy_proj_name"            >> $trlpprj# Hardwire open prj for this project (-prj_name only)set op_prjname="$prj_name"if ("$op_prjname" == "") set op_prjname="$prj_conv"if ("$op_prjname" != "") then   sed s/$dummy_proj_name/$op_prjname/ $trlpprj > $trlpprj_rendif# Change to conv dir.echo "$os_cmd"                       > $trlcdecho "$cd_cmd"                      >> $trlcdecho '__srcdir1__'                  >> $trlcd  # conv dir (abs)echo "$cd_cmd"                      >> $trlcdecho '__srcdir2__'                  >> $trlcd  # conv dir (rel, or '.')# Change dir to cwd - used to get oos from trail files waiting for inputecho "$os_cmd"                       > $trlcdcwdecho "$cd_cmd"                      >> $trlcdcwdecho ''                             >> $trlcdcwd# Generic restore sequence, will be used twice in creation of the# conversion trail file to achieve OOS in the event of 'clip' menus etc.# for import_mode this is the prt/draw import stubs - used once only.if ("$obj_button" != "") then   echo "$obj_button"                > $trlrstr  # New at 6.0endifif ($?import_mode) thenif ("$impfmt" == "prt") then   # Part import commands.   echo '#PART'                     >> $trlrstr   echo '#IMPORT'                   >> $trlrstr   echo '__object__'                >> $trlrstr # new part name   echo '@ ok'                      >> $trlrstr    echo '#IGES IN'                  >> $trlrstr   echo '__rsname__'                >> $trlrstr # igs file nameelse   # Drawing import commands.   if ($?igsdrw_80) then      echo '#DRAWING'                  >> $trlrstr      echo '#IMPORT'                   >> $trlrstr      echo '__object__'                >> $trlrstr # new drawing name      echo '@ ok'                      >> $trlrstr       echo '#IGES IN'                  >> $trlrstr      echo '__rsname__'                >> $trlrstr # igs file name   else      echo '#DRAWING'                  >> $trlrstr      echo '#CREATE'                   >> $trlrstr      echo '__object__'                >> $trlrstr # new drawing name      echo '@ ok'                      >> $trlrstr       echo '#__rstrcmd__'              >> $trlrstr # papersize (misnomer)      echo '#INTERFACE'                >> $trlrstr      echo '#IMPORT'                   >> $trlrstr      echo '#IGES'                     >> $trlrstr      echo '__rsname__'                >> $trlrstr # igs file name   endifendifelse    # import_mode for trlrstrecho '__object__'                   >> $trlrstr  # ex: #PARTecho '__rstrcmd__'                  >> $trlrstr  # ex: #RETRIEVEecho '__rsname__'                   >> $trlrstr  # ex: p1.prtendif   # import_mode for trlrstr# Required between 2 restores in sketcher.echo '#DONE'                         > $trldone# Perform conversions for a particular objectecho "$os_cmd"                       > $trlbodyecho "$cd_cmd"                      >> $trlbodyecho "$dd_abs"                      >> $trlbody  # tmp dir (abs)if ("$dd_rel" != "") then   echo "$cd_cmd"                   >> $trlbody   echo "$dd_rel"                   >> $trlbody  # tmp dir (rel,if necc)endifecho '#ENVIRONMENT'                 >> $trlbodyecho $storecmd                      >> $trlbody  # long or short termecho $geomcmd                       >> $trlbody  # geom or no geomif ("$ftab" == "yes") then   echo "#FAMILY TAB"               >> $trlbody   echo "#VERIFY"                   >> $trlbodyendifecho '#DBMS'                        >> $trlbodyif ("$trlnum" >= "1151")  then  echo '~ Activate `main_dlg_cur` `File.psh_save`'      >> $trlbodyelse  echo "$saveit_cmd"                  >> $trlbodyendifif ("$ftab" == "yes") then   echo '__svname__'                >> $trlbodyelse   echo ''                          >> $trlbodyendif# What is needed to exit Pro/ENGINEER session.echo '#EXIT'                         > $trlexitecho 'y'                            >> $trlexit   # Create a dummy project under Pro/PROJECT for use converting .layscat "$trltop"                        > $trlpprjcrecho '#PROJECT'                     >> $trlpprjcrecho '#MANAGER'                     >> $trlpprjcrecho '#CREATE PROJ'                 >> $trlpprjcrecho '*'                            >> $trlpprjcrecho "$dummy_proj_name"             >> $trlpprjcrecho "$tmpdir"                      >> $trlpprjcrecho '#EXIT'                        >> $trlpprjcrecho 'y'                            >> $trlpprjcr# Delete the dummy project under Pro/PROJECTcat "$trltop"                        > $trlpprjdelecho '#PROJECT'                     >> $trlpprjdelecho '#MANAGER'                     >> $trlpprjdelecho '#OPEN'                        >> $trlpprjdelecho "#$dummy_proj_name"            >> $trlpprjdelecho '#MANAGER'                     >> $trlpprjdelecho '#DELETE PROJ'                 >> $trlpprjdelecho 'y'                            >> $trlpprjdelecho '#EXIT'                        >> $trlpprjdelecho 'y'                            >> $trlpprjdel# Report objs in a project.echo "#REPORT"                       > $trlprepecho "#TREE"                        >> $trlprepecho "#FILE"                        >> $trlprep# Convert a project to Rel 8.0if ("$prj_conv" != "") then   echo '#MANAGER'                  >> $trlprjcnv   echo '#CONVERT PROJ'             >> $trlprjcnv   echo 'update to 8.0'             >> $trlprjcnvendif# PROCESS WHICH RUNS IN BACKROUND AND KILLS PROCMD AFTER DELAYset killer="$tmpdir/killer"echo '#\!/bin/csh -f'                > $killerecho 'sleep $1'                     >> $killerecho $ps_cmd \>\& /tmp/killer.\$\$  >> $killerecho set propid=\`cat /tmp/killer.\$\$ \| grep \"$execname\" \| awk \'\{print \$$pidcol\}\'\`                       >> $killerecho rm -f /tmp/killer.\$\$         >> $killerecho 'if ("$propid" != "") then'    >> $killerecho '   kill -9 $propid'           >> $killerecho '   if ($?PCVT_KILLMSG) then'  >> $killer  echo '      echo "$PCVT_KILLMSG" |& tee -a '$logfile  >> $killerecho '   endif'                     >> $killerecho 'endif'                        >> $killerchmod +x $killer# AWK SCRIPT TO GET DIR/FILE.EXTset dotawk="$tmpdir/dot.awk"cat << CAT_EOF > $dotawk{ full=\$0 nfull=split(full,afull,"/") fev=afull[nfull] split(fev,afev,".") fe = afev[1] "." afev[2] i=1 for (i in afull)    {     if (i == nfull) continue     printf "/%s", afull[i]     i++    }  printf "%s\n", fe}CAT_EOF# GENERATE LIST OF FILES TO CONVERTunset remote_prjhomedirif ("$list" != "") then   cat $list | sed "s+^+$startdir/+" > $convlist.tmpelse if ("$prj_name" != "" || "$prj_conv" != "") then  cd $tmpdir  set trailfile="$trl_tmpname:t"  set nonomatch  rm -f ${trailfile}*  unset nonomatch  cat $trltop $trlpprj_r $trlprep $trlexit > $trl_tmpname  set nonomatch  rm -f $prj_repfile  unset nonomatch  $procmd $runmode $gfxnum 1 $trailfile >& /dev/null  set pro_status="$status"  set nonomatch  set repfile=`$ls_cmd $prj_repfile |& tail -1`  unset nonomatch  # should never happen   if (`echo "$repfile" | grep "$nonoline" | wc -c` > 0 || $pro_status) then     echo ""     echo "ERROR:  Cannot generate tree report for project '$op_prjname'."     echo "        Check the project name and/or Pro/PROJECT server availability."     goto QUICK_EXIT  endif  # GET THE PROJECT MACH AND DIR  set path=($path /etc /usr/etc)  # for ping  set prjname_uc=`echo $op_prjname | tr '[a-z]' '[A-Z]'`  set servfile="/etc/dmsservers.txt"  set num_lines="`cat $servfile | wc -l | tr -d ' '`"  unset found  set curserv=1  while ($curserv <= $num_lines)     set raw=`sed -n "$curserv p" $servfile`     @ curserv++      set servname=`echo "$raw" | awk '{print $1}'`     set acc=`echo "$raw" | awk '{print $2}'`     set arch=`echo "$raw" | awk '{print $4}'`     # Ping servname to see if it's reachable     if ($mc_type =~ sun* || $mc_type == "dg") then        if (`ping $servname 5 |& egrep "(unknown|find)" | wc -c` > 1) then           set loss = ""        else if (`ping $servname 5 | fgrep alive | awk '{print $3}'` != "alive") then           set loss = "100%"        else           set loss = "0%"        endif     else        set ping_pars="$servname -n 2"        if ($mc_type =~ sgi*) set ping_pars="-n -c 2 $servname"        set loss = `ping $ping_pars |& fgrep loss | awk '{print $7}'`     endif     if ($loss == "" || $loss == "100%") continue     if ("$acc" != "direct") set remcmd="$rsh_cmd $servname"     set prjhomemach=`$remcmd cat $arch |& awk '$1 == "'$prjname_uc'" {print $2}' | tr '[A-Z]' '[a-z]'`     if ("$prjhomemach" != "") then        set prjhomedir=`$remcmd cat $arch | awk '$1 == "'$prjname_uc'" {print $5}' | tr '[A-Z]' '[a-z]'`        set found        break      endif  end  if (! $?found) then     echo ""     echo "ERROR:  Cannot determine the project directory."     goto QUICK_EXIT  endif  set targetdir="$prjhomedir"  if ("$prjhomemach" != `hostname`) set remote_prjhomedir    # Allow 50 nodes (dirs) deep - error if deeper.  set col=("" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")  set num_lines="`cat $repfile | wc -l | tr -d ' '`"  set curline=3  while ($curline <= $num_lines)     set numchar=`sed -n "$curline p" $repfile | wc -c`     set obj=`sed -n "$curline p" $repfile | tr -d ' '`     @ curline++      set numobj=`echo "$obj" | wc -c`     @ numsp = ($numchar - $numobj)     set level=`echo "$numsp/10" | bc`  # i.e. num tabs     @ level++                          # +1 for colnum     if ("$level" > "50") then        echo "ERROR:  proj node nesting > 50, skipping $obj"        continue     endif     echo -n "$prjhomedir/" >> ${repfile}_t1     set col[$level]="$obj"     set i=1     while ($i < $level)        echo -n $col[$i]\/ >> ${repfile}_t1        @ i++     end     echo "$col[$level]" >> ${repfile}_t1  end  # Filter junk out - just want things ending in PTC exts (no vers)  egrep '.('$exts_re')$' ${repfile}_t1 > $convlist.realelse   cd $startdir   if ("$descend" == "yes") then      find $startdir -name '*' -type d -print >> $convlist.dirs   else      echo $startdir > $convlist.dirs   endif   set num_lines="`cat $convlist.dirs | wc -l | tr -d ' '`"   set curline=1   while ($curline <= $num_lines)     set dir=`sed -n "$curline p" $convlist.dirs`     set nonomatch     foreach type ($exts)        $ls_cmd $dir/*.$type   >>& $convlist.files        $ls_cmd $dir/*.$type.* >>& $convlist.files     end     unset nonomatch     @ curline++    end    # Some dirs may not have contained any ptcfiles...   grep -v "$nonoline" $convlist.files > $convlist.tmpendif# REMOVE VERSION NUMBERS FROM LIST (except prj report - no vers)if ("$prj_name" == "" && "$prj_conv" == "") then   awk -f $dotawk $convlist.tmp | uniq >& $convlist.realendif# CHECK THAT AT LEAST ONE FILE IS TO BE CONVERTEDset num_lines="`cat $convlist.real | wc -l | tr -d ' '`"if ($num_lines == "0") then   echo ""   echo ""   echo "INFORMATION:  No files to convert (of the following type)  - " |& tee -a $logfile   echo "$ptcfiles" |& tee -a $logfile   goto QUICK_EXITendifecho ""echo ""##################################################################### this section for prj_conv onlyif ("$prj_conv" != "") then   if ($?nlo_env) sleep $nloserv_delay   cd $dumpdir   cat $trltop $trlpprj_r $trlprjcnv $trlexit > __cv__.trl   echo "CONVERTING PROJECT $prj_conv"   echo ""   unset badprostatus   $procmd $runmode $gfxnum 1 __cv__.trl >& $dumpdir/${prj_conv}_msg   if ($status != 0) set badprostatus   if ($?badprostatus) then      echo "# ERROR - COULD NOT CONVERT PROJECT $prj_conv" >> $logfile      echo "# Read messages in $initialdir/${prj_conv}_msg" >> $logfile      cp $dumpdir/${prj_conv}_msg $initialdir      rm -f $dumpdir/${prj_conv}_msg   else      echo "# CONVERTED PROJECT $prj_conv" >> $logfile   endif   echo "" >> $logfile   goto QUICK_EXITendif######################################################################                  PROCESS THE CONVERSION LIST## FILTER OUT NON-CONVERTS AND ESTIMATE CONVERSION SIZEecho ""set msg="1st pass - estimate conversion space requirements"set numchars=`echo "$msg" | wc -c`@ numchars--echo "$msg"repeat $numchars echo -n "-"echo ""echo ""unset files_existset shortsize=0set longsize=0set curline=1set num_lines="`cat $convlist.real | wc -l | tr -d ' '`"# PRJ_NAME - Skip if this is a remote projectif ("$prj_name" != "" && $?remote_prjhomedir) then   cp $convlist.real $convlist   @ curline = ($num_lines + 10)endifwhile ($curline <= $num_lines)   set convfullfile=`sed -n "$curline p" $convlist.real`   set convdir="$convfullfile:h"   @ curline++   # CHECK FILE EXISTS   set nonomatch   set exist=`$ls_cmd $convfullfile* | grep -v '_msg' |& tail -1`   unset nonomatch   if (! -e "$exist" || `echo "$exist" | grep "$nonoline" | wc -c` > 0 ) then

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?