@echo off REM REM dxfdwg.cmd - Shell script to invoke the Unigraphics DXFDWG REM executable with the correct environment settings. REM REM NOTE : This script assumes that UG and DXFDWG have both been REM installed AND that the following UG environment variables REM are defined : REM REM Possible arg1 actions REM ARG1 ACTION REM ---- ------ REM null Set BASE_DIR from the env and call the JAVA UI REM UGII_BASE_DIR Set BASE_DIR from arg1 and call the JAVA UI REM part file Set BASE_DIR from the env and call the command line UI REM rem ************************************************************************ rem Revision History: rem rem REV AUTHOR PR DATE COMMENT rem === ====== ======== ======= ======= rem 001 Ed King 1121268 03Jan02 Process first arg as null, ugii_base_dir rem or part name rem 002 Ed King 22Jan02 Fix the case where the first arg contains a rem space (ie c:\Program Files) rem 003 Ed King 4480849 09Apr02 added -DDXFDWG_DIR to java call rem S. Niblack 4541710 25Jun02 Check for new iMAN & Portal command rem line options. rem S. Niblack 4587918 11Jul02 Fixed problem in finding PARMDONE rem Ed King 1254682 18Dec03 Change ' to " on corba test rem ************************************************************************ rem REM HBB 2005 ------------------------------------- EM Parameter: REM D=def-Datei REM O=Ausgabedatei REM L=Log-Datei REM M=MODE ???????????????? REM S=STEP ???????????????? REM Eingabe-Datei REM I=nur Parameterverschiebung (SHIFT), es passiert nichts REM REM -pim, -corba_ior_file, -u, -p, and -g sind iMAN und Portal -Optionen REM REM Die Konvertierungsrichung wird ueber die DEF-Datei festgelegt. REM REM PRT -> IGES REM iges-batch.cmd d=igesexport.def o=d:\training\test.iges -l=d:\iges.log d:\test.prt REM REM IGES -> PRT REM iges-batch.cmd d=igesimport.def o=d:\training\test.prt -l=d:\iges.log d:\test.iges REM ---------------------------------------------- REM set a default in case the first arg is not UGII_BASE_DIR set BASE_DIR=%UGII_BASE_DIR% REM remove the double quotes from the first arg if present set arg1=%1 set ARG1_WITHOUT_QUOTES=%arg1:"=% REM If first arg is UGII_BASE_DIR reset BASE_DIR if exist "%ARG1_WITHOUT_QUOTES%\ugii" set BASE_DIR=%ARG1_WITHOUT_QUOTES% if "%DXFDWG_DIR%" == "" set DXFDWG_DIR=%BASE_DIR%\dxfdwg\ REM If first arg is UGII_BASE_DIR process as java gui if exist "%ARG1_WITHOUT_QUOTES%\ugii" goto JAVA_GUI REM If the first arg is null process as java gui if {%1} == {} goto JAVA_GUI REM Process all of the input parameters. NT removes the = from the REM o=value part of the input so we have to rebuild it. REM DOS is stupid so have to account for lower and UPPER case input :Loop if '%1'=='' goto PARMDONE if '%1'=='o' goto OUT if '%1'=='O' goto OUT if '%1'=='l' goto LOG if '%1'=='L' goto LOG if '%1'=='d' goto DEF if '%1'=='D' goto DEF if '%1'=='m' goto MODE if '%1'=='M' goto MODE if '%1'=='s' goto STEP if '%1'=='S' goto STEP if '%1'=='i' goto INDIV if '%1'=='I' goto INDIV if '%1'=='-pim' goto PIM1 if '%1'=='-pim:yes' goto PIM2 if '%1'=='-corba_ior_file' goto CORBA1 if '%1'=='-u' goto USER if '%1'=='-p' goto PASSWD if '%1'=='-g' goto GROUP REM PR 4541710 REM One more check for the -corba_ior_file. It sometimes comes in wrapped REM in double quotes so that it doesn't get separated from it's file name. REM Here we need to strip the double quotes and strip of the "=." REM Then we can make another test for the -corba_ior_file. set arg1=%1 set ARG1_WITHOUT_QUOTES=%arg1:"=% set ARG1_WITHOUT_FILE=%ARG1_WITHOUT_QUOTES:~0,15% if "%ARG1_WITHOUT_FILE%"=="-corba_ior_file" goto CORBA2 REM Handle any other char=param parameters as invalid input for %%v in (a b c e f g h j k m n p q r t u v w x y z) do if '%1'=='%%v' goto Invalid for %%v in (A B C E F G H J K M N P Q R T U V W X Y Z) do if '%1'=='%%v' goto Invalid REM otherwise default to this being the input file parameter goto INPUT REM Commands to build the o=outputfile parameter :OUT set out=%1 shift set outval=%1 set fullout='' if '%outval%'=='' goto NextParm set fullout=%out%=%outval% goto NextParm REM Commands to build the l=logfile parameter :LOG set out=%1 shift set logval=%1 set fulllog='' if '%logval%'=='' goto NextParm set fulllog=%out%=%logval% goto NextParm REM Commands to build the d=deffile parameter :DEF set out=%1 shift set defval=%1 set fulldef='' if '%defval%'=='' goto NextParm set fulldef=%out%=%defval% goto NextParm REM Commands to build the m=mode parameter :MODE set out=%1 shift set modeval=%1 set fullmode='' if '%modeval%'=='' goto NextParm set fullmode=%out%=%modeval% goto NextParm REM Commands to pass the inputfile parameter :INPUT set input=%1 goto NextParm REM PR 4541710 REM -pim, -corba_ior_file, -u, -p, and -g are iMAN and Portal REM options that need to be passed onto UF_UGMGR_initialize. :PIM1 set out=%1 shift set outval=%1 set pim='' if '%outval%'=='' goto NextParm set pim=%out%=%outval% goto NextParm :PIM2 set pim=%1 goto NextParm :CORBA1 set out=%1 shift set outval=%1 set corba='' if '%outval%'=='' goto NextParm set corba=%out%=%outval% goto NextParm :CORBA2 set corba=%1 goto NextParm :USER set out=%1 shift set outval=%1 set user='' if '%outval%'=='' goto NextParm set user=%out%=%outval% goto NextParm :PASSWD set out=%1 shift set outval=%1 set passwd='' if '%outval%'=='' goto NextParm set passwd=%out%=%outval% goto NextParm :GROUP set out=%1 shift set outval=%1 set group='' if '%outval%'=='' goto NextParm set group=%out%=%outval% goto NextParm REM point to the next parameter and start all over :NextParm shift goto Loop REM the DXFDWG and INDIV targets will be implemented for IMAN integration REM otherwise this is any other char=value input param. Done here to REM prevent overwritting the input file parameter :DXFDWG :INDIV :Invalid shift shift goto Loop :JAVA_GUI set PATH=%BASE_DIR%\UGII;%PATH% REM allow the user to use their own JRE or JAR if "%UGII_DEX_JRE%" == "" set UGII_DEX_JRE=%BASE_DIR%\xlatorui\dex if "%UGII_DEX_JAR%" == "" set UGII_DEX_JAR=%BASE_DIR%\xlatorui @call "%UGII_DEX_JRE%\bin\java" -classpath "%UGII_DEX_JAR%\dex.jar" -DUGII_BASE_DIR="%BASE_DIR% " -DDXFDWG_DIR="%DXFDWG_DIR% " com.dex.splash.DXFDWGSplashScreen @IF not %ERRORLEVEL% == 0 pause GOTO OK :PARMDONE @call "%DXFDWG_DIR%\dxfdwg.exe" %input% %fullout% %fulllog% %fulldef% %fullmode% %pim% %corba% %user% %passwd% %group% @IF not %ERRORLEVEL% == 0 pause :OK @ECHO Translator exiting .....