@echo off
call alg1
chkrot %1
if errorlevel 2 goto exit
if errorlevel 1 goto vertical

:horizontal
pushd
c:
copy %1 c:\tmp\plotf.dwg
cd \dplot
dplot c:\tmp\plotf.dwg fp.dev
cd \pmi
printgl /FL /MF1 /J27,40,115,49,81 /O3 /LF6.90,10.20,0.7,0.7 /WA /P c:\tmp\plotf.dpl
del c:\tmp\plotf.*
popd
goto exit

:vertical
pushd
c:
copy %1 c:\tmp\plotf.dwg
cd \dplot
dplot c:\tmp\plotf.dwg fp.dev
cd \pmi
printgl /FL /MF1 /J27,40,115,49,81 /O2 /LF6.90,10.20,0.7,0.7 /WA /P c:\tmp\plotf.dpl
del c:\tmp\plotf.*
popd

:exit