forked from LibreDWG/libredwg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dxf-check
executable file
·43 lines (38 loc) · 1.12 KB
/
dxf-check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
d=${1:-example_2000}
b=$(basename $d .dxf)
r=2000
if [ $(dirname $d) != . ]; then
r=$(dirname $d)
fi
case $r in
20*) ;;
r9) r=9 ;;
r1[0234]) r=${r:1} ;;
*) case $f in
*_20*) r=${b:(-4)}; f=`basename $b _$r` ;;
*_r9) r=9; f=`basename $b _r$r` ;;
*_r1[0234]) r=${b:(-2)}; f=`basename $b _r$r` ;;
*) echo wrong version $r ;;
esac ;;
esac
if [ $(dirname $d) != . ]; then
b=${b}_${r}
fi
case `uname` in
Darwin) TeighaFileConverter=/Applications/TeighaFileConverter.app/Contents/MacOS/TeighaFileConverter ;;
Linux) TeighaFileConverter=/usr/bin/TeighaFileConverter ;;
Windows) TeighaFileConverter=TeighaFileConverter ;;
esac
./log -v4 $d
rm $d.dwg 2>/dev/null
./dxf -y -v4 $d
make -s -j4 -C programs dwg2dxf
echo programs/dwg2dxf -v4 -y $b.dwg 2\>$b.dwg.log
programs/dwg2dxf -v4 -y $b.dwg 2>$b.dwg.log
cp $b.dwg test/
echo TeighaFileConverter "test" "." ACAD2000 DXF 0 1 $b.dwg
$TeighaFileConverter "test" "." ACAD2000 DXF 0 1 $b.dwg
cat $b.dxf.err
echo diff -bu $b.log $b.dwg.log
diff -bu $b.log $b.dwg.log