#!/bin/csh #Tag 0x006A0017 ################################################################################# # # ##### # # # # # ##### #### # # #### ##### # ##### ##### # # # # # # # # # # # # # # # # # # # # # # # # # ##### # # # # # # # # ####### # # # # # # # ##### # ##### # # # # # # # # # # # # # # # # # # # # # #### # #### ##### #### # # # # # ################################################################################# # This is an example of automatically generating an AutoScript for background # processing a group of AutoCAD files. In this case, all PostScript Type 1 # font files (*.pfb) are compiled into AutoCAD font format (*.shx). ################################################################################# # # Define some shell variables for convenience # # Command to start AutoScript facility. setenv AUTOSCRIPT autoscript # A dummy drawing file. setenv DUMMY dummy # The generated AutoScript command file. setenv SCR_FILE compile.scr # File match pattern setenv PATTERN pfb # The AutoCAD comamnd to process the font file. setenv ACAD_CMD _COMPILE # Disable dialog boxes. setenv FILEDIA_CMD "_FILEDIA 0" # Exit the drawing, discarding changes setenv QUIT_CMD "_QUIT _YES" # # Foreach command processes each command in sequence # foreach i ( `/bin/ls *.$PATTERN` ) ### ### Indicate beginning of command ### echo "Processing $i...\c" ### ### Create an AutoScript command file, stripping the file extension for the file name. ### echo "$FILEDIA_CMD $ACAD_CMD `echo $i | sed 's/\.$PATTERN//'` $QUIT_CMD" >$SCR_FILE ### ### Make the AutoScript file executable (not really necessary, but added for completeness). ### chmod +rwx $SCR_FILE ### ### Launch the AutoScript facility with the command file. ### $AUTOSCRIPT $DUMMY $SCR_FILE ### ### Erase the command file when finished. ### rm -f $SCR_FILE ### ### Indicate completion of the command. ### echo "done." # # End of the foreach loop. # end