/* importdlgs.aml /* converts all optional-format DLGs in working directory /* to composite arc coverages /* Ralph Haugerud, USGS Seattle /* Harvey Greenberg, University of Washington /* last modified April 1998 /* rhaugerud@usgs.gov /* hgreen@u.washington.edu /* /* Warning: this routine makes unix system calls display 0 &ty [delete flist -file] &sys ls *.opt.gz > flist &s file1 = [open flist openstat -r] &if %openstat% > 0 &then &type 'Failed to open flist' &s fname = [READ %file1% readstat] &do &while %readstat% = 0 &if %readstat% = 0 &then &do &type %fname% &call ImportOneDLG &end &s fname = [READ %file1% readstat] &end &type 'Success at last!' &return /**************************** &routine ImportOneDLG &set infile = %fname% &set cover = [locase [substr %infile% 1 7] ] &set newfile = [substr [locase %infile%] 1 8] &set infile = [quote %infile%] &sys mv %infile% fred.gz &sys gzip -d fred /* line above may need to be edited, depending on what /* gzip is called and how it works on your system &sys dd if=fred of=newfile ibs=8000 cbs=80 conv=unblock &if [delete fred -file] <> 0 &then &type 'delete fred failed' &set outcov = %cover% &set quad = newfile &sys echo " " >> %quad% &if [exist af1 -cover] &then kill af1 all &if [exist pf1 -cover] &then kill pf1 all &s af af1 &s pf pf1 /* even though we don't use points DLGARC OPTIONAL %quad% %af% %pf% &if [exists %af%.acode -INFO] &then &do build %af% arc joinitem %af%.aat %af%.acode %af%.aat %af%-id %af%-id &if ^ [iteminfo %af% -ARC MINOR1 -exists] &then additem %af%.aat %af%.aat MINOR1 6 6 I &if ^ [iteminfo %af% -ARC MAJOR2 -exists] &then additem %af%.aat %af%.aat MAJOR2 6 6 I &if ^ [iteminfo %af% -ARC MINOR2 -exists] &then additem %af%.aat %af%.aat MINOR2 6 6 I &if ^ [iteminfo %af% -ARC MAJOR3 -exists] &then additem %af%.aat %af%.aat MAJOR3 6 6 I &if ^ [iteminfo %af% -ARC MINOR3 -exists] &then additem %af%.aat %af%.aat MINOR3 6 6 I &if ^ [iteminfo %af% -ARC MAJOR4 -exists] &then additem %af%.aat %af%.aat MAJOR4 6 6 I &if ^ [iteminfo %af% -ARC MINOR4 -exists] &then additem %af%.aat %af%.aat MINOR4 6 6 I arcedit editcover %af%; editfeature arc; select all &if [exist %outcov% -cover] &then &do put %outcov%;Y &end &else put %outcov% quit /* ARCEDIT &end kill %af% all &if [exists %pf%.xcode -INFO] &then &do build %pf% point joinitem %pf%.pat %pf%.xcode %pf%.pat %pf%-id %pf%-id &if ^ [iteminfo %pf% -POINT MINOR1 -exists] &then additem %pf%.pat %pf%.pat MINOR1 6 6 I &if ^ [iteminfo %pf% -POINT MAJOR2 -exists] &then additem %pf%.pat %pf%.pat MAJOR2 6 6 I &if ^ [iteminfo %pf% -POINT MINOR2 -exists] &then additem %pf%.pat %pf%.pat MINOR2 6 6 I &if ^ [iteminfo %pf% -POINT MAJOR3 -exists] &then additem %pf%.pat %pf%.pat MAJOR3 6 6 I &if ^ [iteminfo %pf% -POINT MINOR3 -exists] &then additem %pf%.pat %pf%.pat MINOR3 6 6 I &if ^ [iteminfo %pf% -POINT MAJOR4 -exists] &then additem %pf%.pat %pf%.pat MAJOR4 6 6 I &if ^ [iteminfo %pf% -POINT MINOR4 -exists] &then additem %pf%.pat %pf%.pat MINOR4 6 6 I arcedit editcover %pf%; editfeature point; select all &if [exist %outcov%.pat -info] &then &do put %outcov%;Y &end &else put %outcov% quit /* ARCEDIT &end kill %pf% all &if [delete newfile -file] <> 0 &then &type 'delete newfile failed' &return &return