procvter
来自「proe5.0野火版下载(中文版免费下载)」· 代码 · 共 2,131 行 · 第 1/5 页
TXT
2,131 行
set tmpdir="$tmpdir/$pid"if (! -d $tmpdir) then mkdir $tmpdir if ($status) then echo "ERROR: can not create tmp work dir '$tmpdir'" exit 1 endifendiftouch $tmpdir/convert.$pidif ($status) then echo "ERROR: '$tmpdir' - can't write into this tmp work dir" exit 1endifrm -f $tmpdir/convert.$pidset tmpdir=`(cd $tmpdir; echo $cwd)`if ("$user_cfgfile" != "none" && "$user_cfgfile" != "existing" && "$user_cfgfile" != "") then if (! -e $user_cfgfile) then echo "ERROR: no such file $user_cfgfile" echo "" echo " Config file values are 'none', 'existing' OR the name of" echo " a config. file, type $name -help for more info." exit 1 endif set cfgdir="" if ("$user_cfgfile:h" == "$user_cfgfile:t") set cfgdir="$initialdir" if ("$cfgdir" == "") set cfgdir="$user_cfgfile:h" set cfgdir=`(cd $cfgdir; echo $cwd)` set user_cfgfile="$cfgdir/$user_cfgfile:t" endif endifset choice=" all dms nlo none "if (`echo "$choice" | grep " $validservs " | wc -l` == 0) then echo "ERROR: invalid value for -validservs, choices are" echo " $choices" exit 1endif## GRAPHICS/RUNMODE/SERVERS #set nloserv_timeout="720" # 12 minsset nloserv_delay="60"set dmsserv_delay="40"unset nlo_envunset dms_envif (-e /etc/nloservers.txt || -e /etc/nloserverlist.txt) then if ($validservs == "all" || $validservs == "nlo") then set nlo_env echo "" repeat $lm echo -n " "; echo "INFO: Running in a Pro/NLO environment." repeat $lm echo -n " "; echo "Pausing $nloserv_delay secs before each conversion for licence acquisition." endifendifif (-e /etc/dmsservers.txt) then if ($validservs == "all" || $validservs == "dms") then set dms_env echo "" repeat $lm echo -n " "; echo "INFO: Running in a Pro/PROJECT environment." endifendif# NECC. AND SUFF. CONDITIONS FOR MODES OF OPERATIONif ("$prjdir" == "yes" && ! $?prjutil_exists) then echo "" echo "ABORTING: No Pro/PROJECT files can be converted without the" echo " $prjutil utility file" exit 1endifif (("$prj_name" != "" || "$prj_conv" != "") && ! $?dms_env) then echo "" echo "ABORTING: /etc/dmsservers.txt is not present." echo " Must run in a Pro/PROJECT environment to convert a project" exit 1endif## INITIALIZATIONS## NAME OF EXECUTABLEset execname=`tail -1 $procmd | awk '{print $1}'`if (! -x "$execname" && "$killdelay" != 0) then echo "" echo "WARNING: Cannot determine executable name from '$procmd'" echo " Setting maximum time for file conversion to unlimited" echo "" set killdelay="0"endif# INITIAL DIR AND LOGFILEset logfile="$initialdir/$name.log"touch $logfile.$$if ($status) then echo "ERROR: can't write into this directory '$initialdir'" exit 1endifrm -f $logfile.$$if (-e $logfile) then mv -f $logfile ${logfile}_oldendif# WRITE HEADER INFO TO LOGFILEecho "# Log file produced by the PTC $name utility v$script_vers" > $logfileecho "#" >> $logfileecho "# Started: `date`" >> $logfileecho "#" >> $logfileecho "# Directory: $initialdir" >> $logfileecho "#" >> $logfileecho "# Command: $name $arglist" >> $logfileecho "#" >> $logfileecho "# procmd $procmd" >> $logfileif ($?import_mode) then echo "# impfmt $impfmt" >> $logfile if ("$papersize" != "") echo "# papersize $papersize" >> $logfile echo "# impext $impext" >> $logfileendifif ("$prjdir" != "") echo "# prjdir $prjdir" >> $logfileif ("$prj_name" != "") echo "# prj_name $prj_name" >> $logfileif ("$prj_conv" != "") echo "# prj_conv $prj_conv" >> $logfileif ("$startdir" != "") echo "# startdir $startdir" >> $logfileif ("$list" != "") echo "# filelist $list" >> $logfileif ("$descend" != "") echo "# descend $descend" >> $logfileif ("$targetdir" != "") echo "# targetdir $targetdir" >> $logfileif ("$geommode" != "") echo "# geommode $geommode" >> $logfileif ("$storemode" != "") echo "# storemode $storemode" >> $logfileif ("$purgefiles" != "") echo "# purgefiles $purgefiles" >> $logfileif ("$forceconvert" != "") echo "# forceconvert $forceconvert" >> $logfileif ("$killdelay" != "0") echo "# killdelay $killdelay" >> $logfileecho "# tmpdir $tmpdir" >> $logfileif ("$min_space" != "0") echo "# min_space $min_space" >> $logfileif ("$user_cfgfile" != "") echo "# user_cfgfile $user_cfgfile" >> $logfileecho "" >> $logfile# MAP FILE EXTS INTO PRO/E BUTTONSif ("$ftab" == "yes") then set exts = ("prt" "asm") set exts_out = `echo "$exts"` set buttons = ("#PART" "#ASSEMBLY")else if ($?import_mode) then set exts = ("$impext") set exts_out = ("$impfmt") set buttons = ("") # not used, but set for safety.else set exts = ("mfg" "drw" "asm" "prt" "sec" "lay" "prj") set exts_out = `echo "$exts"` set buttons = ("#MANUFACTURE" "#DRAWING" "#ASSEMBLY" "#PART" "#SKETCHER" "#LAYOUT" "#PROJECT")endifset exts_re=`echo "$exts" | tr ' ' '|'`# INDICATES A DUMMY HEADER FILE for -projdir modeset dumheadstr="_PROCVT_DUMMY_"set shorttypetag="ENDSPGSHORTTERMFILE"set longtypetag="END_OF_UGC"set rev8prjtag="#>START" # start of second line of 8.0 prj file.if ("$storemode" == "short") then set storecmd="#SHORT TERM"else set storecmd="#LONG TERM"endifif ("$geommode" == "geom") then set geomcmd="#STORE GEOMETRY"else set geomcmd="#NO GEOMETRY"endif# ESTIMATESset s_l="1.9" # 1.88set s_lg="5.5" # 5.52set l_s="0.7" # 0.73set l_sg="1.4" # 1.42set s_sg="2.3" # 2.29set l_lg="2.6" # 2.60set safety="0.2" # Over-estimate by 20%set s_l="($s_l+($safety*$s_l))"set s_lg="($s_lg+($safety*$s_lg))"set l_s="($l_s+($safety*$l_s))"set l_sg="($l_sg+($safety*$l_sg))"set s_sg="($s_sg+($safety*$s_sg))"set l_lg="($l_lg+($safety*$l_lg))"# VALID FILE SPECS.set ptcfiles=""set ptcfiles_out=""set i=1while ($i <= $#exts) set comma="," if ($i == 1) set comma="" set ptcfiles="$ptcfiles${comma}*.$exts[$i]*" set ptcfiles_out="$ptcfiles_out${comma}*.$exts_out[$i]*" @ i++endset noglobset ptcfiles_sp=`echo "$ptcfiles" | tr ',' ' '`set ptcfiles_out_sp=`echo "$ptcfiles_out" | tr ',' ' '`unset noglob# NAME SCRATCH FILES AND DIRECTORIESset convlist="$tmpdir/list.txt" # the list of convertsset mergelist="$tmpdir/merge.txt" # used in -proj modeset msglist="$tmpdir/msg.txt" # used in -proj mode# Where Pro/E will store objs on each conversion.set dumpdir="$tmpdir/dump"mkdir $dumpdir# proconvert's private start and target dirs (used by -prjdir mode only)if ("$prjdir" == "yes") then set prvstartdir="$tmpdir/prvs" set prvtargetdir="$tmpdir/prvt" mkdir $prvstartdir mkdir $prvtargetdirendif# proconvert's private fetch dir (used by -prj_name only)set fetchdir="$tmpdir/fetch"mkdir $fetchdir## GENERATE AUXILIARY FILES## TRAIL FILE FRAGMENTS# dynamic means generated much later and many (different) times.set trlend="$tmpdir/trlend.txt" # Get the curr trl file banner.set trltop="$tmpdir/trltop.txt" # The trl file banner.set trlprj="$tmpdir/trlprj.txt" # Prefix (no Pro/PROJECT)set trlpprj="$tmpdir/trlpprj.txt" # Prefix (Pro/PROJECT)set trlpprj_r="$tmpdir/trlpprj_r.txt" # used by -prj_name onlyset trlprjcnv="$tmpdir/trlprjcnv.txt" # used by -prj_conv onlyset trlcd="$tmpdir/trlcd.txt" # Change dir.set trlcdcwd="$tmpdir/trlcdcwd.txt" # used to oos trail file inputset trlrstr="$tmpdir/trlrstr.txt" # Restore obj cmdsset trldone="$tmpdir/trldone.txt" # Needed for .sec rstrset trlbody="$tmpdir/trlbody.txt" # Convert cmdsset trlexit="$tmpdir/trlexit.txt" # Exit/y cmdsset trlpprjcr="$tmpdir/trlpprjcr.txt" # Create Pro/PROJECT prjset trlpprjdel="$tmpdir/trlpprjdel.txt" # Delete Pro/PROJECT prjset dummy_proj_name="${name}_tmp"set my_cfgfile="$tmpdir/my_config.pro" # Mandatory config.pro settingsset realcfg="$tmpdir/realcfg.pro" # final config.pro run w/ Pro/Eset trl_tmpname="$tmpdir/trltmpnm.txt" # transient usage. (dynamic)set trlpfet="$tmpdir/trlpfet.txt" # -prj_name, fetch (dynamic)set trlpsub="$tmpdir/trlpsub.txt" # -prj_name, submit (dynamic)set trlpunf="$tmpdir/trlpunf.txt" # -prj_name, unfetch (dynamic)set trlprep="$tmpdir/trlrep.txt" # -prj_name, report# Obtain the current tail file version number. echo \!trail file version No\. 0 > $trlend echo "#EXIT" >> $trlendecho "y" >> $trlendcd $tmpdir# Pro/E should not crash in tmpdir, but just in case..rm -f coretouch corechmod 000 coretouch trail.txt.$pid # fake out the next rmrm -f trail.txt* >& /dev/nullset trailfile="$trlend"set temp_cfg="$proe_lp/text/config.sup"set trail_dirif ( -e $temp_cfg ) then set trail_dir=`grep trail_dir $temp_cfg | awk '{print $NF}'`endifset temp_cfg="$tmpdir/config.pro"touch $temp_cfgif (! -e "$trail_dir" ) then echo "trail_dir $tmpdir" > $temp_cfg set trail_dir="$tmpdir"else pushd $trail_dir set last_trail=`ls trail.txt.* |tail -1` popd echo "" echo "WARNING: config.sup contains a trail_dir entry." echo ""endif$procmd $runmode $gfxnum 1 $trailfile >& /dev/nullrm -f $temp_cfgpushd $trail_dirset this_trail=`ls -tr trail.txt.* |tail -1`if ($?last_trail) then if ( $last_trail == $this_trail ) then echo "" echo "ERROR: '$procmd' - not a command to run Pro/ENGINEER" echo "" exit 1 endifelse if (! -e $this_trail) then echo "" echo "ERROR: '$procmd' - not a command to run Pro/ENGINEER" echo "" exit 1endifset trltopline = `cat $this_trail | sed -n "1 p"`set trlnum=`echo $trltopline[$#trltopline]`echo "$trltopline" > $trltoppopd#################### TRAIL FILE VERSION CHECKS ##################### If we are running on SGI w/ pro >= 5.0-9011 don't have to do gfxif ("$mc_type" =~ sgi* && "$trlnum" >= "253") set gfxnum="0"# A-24-11 + uses new report filename, changed again at a-25-06.if ("$trlnum" <= "362") then set prj_repfile="tree*.lis.1"else if ("$trlnum" < "383") then set prj_repfile="*.tmp.1"else set prj_repfile="*.t_r.1"endif# Menu button changeset cd_cmd="#CHANGE_DIR"if ("$trlnum" >= "464") then set os_cmd="#MISC" set cd_cmd="#CHANGE DIR"else if ("$trlnum" >= "275") then set os_cmd="#MISC."else set os_cmd="#OS"endif# 6.0 button changeset obj_button=""if ("$trlnum" == "340") set obj_button="#OBJECTS"if ("$trlnum" >= "341") set obj_button="#MODE"# Pro/E's ability to cd to long dirs - 31, hedge at 28 !set maxdirlen=""set wc_maxdirlen="1000"if ("$trlnum" <= "255") then set maxdirlen="28" # have to do 2 cd's after this @ wc_maxdirlen = ($maxdirlen + 1) # wc 'overcounts' \nendif# CONFIG KEYWORDSrm -f $my_cfgfile# prompt_on_exit - present at 4.0, so always put it in echo "prompt_on_exit no" >> $my_cfgfileecho "import_in_file_open no" >> $my_cfgfile# store_only_in_current - starting at 5.1, value change at 5.2set svopt_key="store_only_in_current"set svopt_val="yes"if ("$trlnum" <= "294") set svopt_val="true" # 5.1/2beta valueif ("$trlnum" >= "341") set svopt_key="override_store_back" # 6.0 keywdif ("$trlnum" >= "278") echo "$svopt_key $svopt_val" >> $my_cfgfile# ignore_family_type - starting at 6.0if ("$trlnum" >= "331") echo "ignore_family_type yes" >> $my_cfgfile# Mutually exclusive and Pro/E vers dependant Pro/PROJECT methods.if ("$trlnum" >= "342") then if ("$prjdir" == "yes") then echo "" echo "ERROR: project directory mode (-prjdir) is not valid with this" echo " version of Pro/ENGINEER (6.0+)." echo " Use project name mode (-prj_name) instead." exit 1 endifelse if ("$prj_name" != "") then echo "" echo "ERROR: project name mode (-prj_name) is not valid with this" echo " version of Pro/ENGINEER (5.0)." echo " Use project directory mode (-prjdir) instead." exit 1 endifendifif ("$prj_conv" != "" && "$trlnum" < "459") then echo "" echo "ERROR: the project conversion option (-prj_conv) is not valid with" echo " this version of Pro/ENGINEER - you must use Release 8.0" echo "" exit 1endif# No interactivity for real Pro/PROJECT modeif ("$prj_name" != "") then echo "user_proj_interface no" >> $my_cfgfileendif# import_mode switches - stops potential interactivity in igs drw read.if ($?import_mode) then echo "iges_drawing_number 1" >> $my_cfgfile echo "iges_drawing_scaling translate" >> $my_cfgfileendif# 8.0 project button renamesif ("$trlnum" >= "457") then set modify_keywd="#LATEST" set unfetch_keywd="#UNLOCK"else set modify_keywd="#MODIFY" set unfetch_keywd="#UNFETCH"endif# 8.0 drawing iges in button changesif ("$trlnum" >= "481") then
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?