#!/bin/csh -f
#Tag 0x006A0001
#############################################################################
#
# This is the shell script used to launch AutoCAD R13 with NULL display
#
# Usage:
#	autoscript [initial file] [initial script]
#
# Example:
#	autoscript nozzle wblock	(Will start AutoCAD 12,
#					load 'nozzle.dwg' and 
#					activates 'wblock.scr')
#
#############################################################################
#
setenv ACADDISPLAY NULL
#
#############################################################################
#
# Start up a text window, then launch AutoCAD with the arguments (if any)
#
# NOTE: The AutoCAD Text Window geometry, etc. is set here
#----------------------------------------------------------------------------
# Change: -fn FontNN to change the font and size
# Change: -geometry ColsxRows+17-17 to change the size of the window
# Change: -geometry 80x25+XX-YY to change the lower left corner of the window
# Change: -fg color to change the window text color 
# Change: -bg to change the window background color 
# Change: -cursorbg to change the cursor color 
# Change: -sl nnn to change the number of lines saved in the text window
# Change: -title 'abc' to change the Text Window Title
#
# You should not need to change any of the other options.
#
#############################################################################
#
if ($#argv > 0) then
	setenv _ICONNAME `basename $argv[1]`
else
	setenv _ICONNAME "AcadT"
endif
setenv _WSH	"/usr/sbin/xwsh"
setenv _FONT	"-fn Screen15"
setenv _GEOM	"-geometry 80x25+0-0"
setenv _COLOR	"-fg yellow -bg blue -cursorbg yellow"
setenv _SCROLL	"-sl 4000"
setenv _TITLE	"-title Autoscript_Window -icontitle $_ICONNAME"
setenv _OPTIONS	"-holdonerror -name AcadT -iconic"
setenv _KEYMAP	"-keymap $ACADPATH/AcadT.keymap"
setenv _ACAD	"-e /opt/acad13/bin/acadr13"
#
if ($#argv > 1) then
	#-------------------------------------------------------#
	# Start AutoCAD with an initial drawing and script file #
	#-------------------------------------------------------#
	if (-e $ACADPATH/AcadT.keymap) then
		$_WSH $_FONT $_GEOM $_COLOR $_SCROLL $_TITLE $_OPTIONS $_KEYMAP $_ACAD $argv[1] $argv[2]
	else
		$_WSH $_FONT $_GEOM $_COLOR $_SCROLL $_TITLE $_OPTIONS $_ACAD $argv[1] $argv[2]
	endif
else if ($#argv > 0) then
	#--------------------------------------------#
	# Start AutoCAD with an initial drawing file #
	#--------------------------------------------#
	if (-e $ACADPATH/AcadT.keymap) then
		$_WSH $_FONT $_GEOM $_COLOR $_SCROLL $_TITLE $_OPTIONS $_KEYMAP $_ACAD $argv[1]
	else
		$_WSH $_FONT $_GEOM $_COLOR $_SCROLL $_TITLE $_OPTIONS $_ACAD $argv[1]
	endif
else
	#---------------#
	# Start AutoCAD #
	#---------------#
	if (-e $ACADPATH/AcadT.keymap) then
		$_WSH $_FONT $_GEOM $_COLOR $_SCROLL $_TITLE $_OPTIONS $_KEYMAP $_ACAD
	else
		$_WSH $_FONT $_GEOM $_COLOR $_SCROLL $_TITLE $_OPTIONS $_ACAD
	endif
endif
