
! script name: defaults.d/defaultvalues
! topic: set system default values

!A
!A NAME:
!A
!A 	Set Default Values
!A
!A DESCRIPTION:
!A
!A 	This script allows the following system default values to be set:
!A
!A 		LINE LENGTH
!A 		DIRECTION ARROW HEIGHT
!A 		DIRECTION ARROW WIDTH
!A 		DIRECTION ARROW STYLE
!A 		INTERSECT TOLERANCE
!A 		INTERSECT DELTA
!A
!B INSTRUCTIONS:
!B
!B 	LINE LENGTH: This allows a line that is is constructed to default
!B 		to this length.
!B
!B 	NOTE: The DIRECTION ARROW is the arrow that appears when a contour
!B 		is highlighted.
!B
!B 	DIRECTION ARROW HEIGHT: This allows the height of the arrow to be
!B 		defined.
!B
!B 	DIRECTION ARROW WIDTH: This allows the width of the arrow to be
!B 		defined.
!B
!B 	DIRECTION ARROW STYLE: Style of arrow tip.
!B
!B 	INTERSECT TOLERANCE: This is a variable that is used internally.
!B 		The tolerance would be used for the intersection of two
!B 		entities.  If the intersection is two nurbs and the
!B 		tolerance is very small, the calculating time will increase.
!B
!B 	INTERSECT DELTA: This is a variable that is used internally.
!B 		The delta is used to insure unique intersections.
!B
!B	LINEAR REFINE TOLERANCE: This variable sets the tolerance for
!B		refining chains of line segments. Used in offsets of
!B		spline curves.
!B
!B	CIRCLE APPROXIMATION TOLERANCE: This sets the tolerance for
!B		circular approximation. Used in offsets of spline curves
!B		and in 3D.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: set default values ")

DIM Answer$[256]
DIM Name$[256]
DIM Destination$[256]
DIM Title$[256]
DIM Label$[256]
DIM Namelist$[700]
DIM Directory$[700]

DEG

Start:!

Title$="SET DEFAULT VALUES"
Label$="ITEM SELECTED"

A= GetDefault(WsLineLength)
Namelist$="LINE LENGTH:   "&VAL$(A)&","

A= GetDefault(WsDirArrowHeight)
Namelist$=Namelist$&"DIRECTION ARROW HEIGHT:   "&VAL$(A)&","

A= GetDefault(WsDirArrowWidth)
Namelist$=Namelist$&"DIRECTION ARROW WIDTH:   "&VAL$(A)&","

A= GetDefault(WsDirArrowStyle)
Namelist$=Namelist$&"DIRECTION ARROW STYLE:   "&VAL$(A)&","

A= GetDefault(WsIntersectTol)
Namelist$=Namelist$&"INTERSECT TOLERANCE:   "&VAL$(A)&","

A= GetDefault(WsIntersectDelta)
Namelist$=Namelist$&"INTERSECT DELTA:   "&VAL$(A)&","

A= GetDefault(WsLinearRefineTol)
Namelist$=Namelist$&"LINEAR REFINE TOLERANCE:   "&VAL$(A)&","

A= GetDefault(WsCircleApproxTol)
Namelist$=Namelist$&"CIRCLE APPROXIMATION TOLERANCE:   "&VAL$(A)&","

Stat=GeneralListBox(Title$,Label$,Namelist$)
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT ITEM",Answer$)
IF (ExitScript(Destination$)) THEN Leave

stat= SetInputFormat("n4","")

Name$=Answer$
A= POS(Name$,":")
IF A>1 THEN
	Name$= Name$[1,A-1]
END IF


SELECT Name$
CASE "LINE LENGTH"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsLineLength)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsLineLength,Answer)

CASE "DIRECTION ARROW HEIGHT"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsDirArrowHeight)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsDirArrowHeight,Answer)

CASE "DIRECTION ARROW WIDTH"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsDirArrowWidth)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsDirArrowWidth,Answer)

CASE "DIRECTION ARROW STYLE"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsDirArrowStyle)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsDirArrowStyle,Answer)

CASE "INTERSECT TOLERANCE"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsIntersectTol)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsIntersectTol,Answer)

CASE "INTERSECT DELTA"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsIntersectDelta)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsIntersectDelta,Answer)

CASE "LINEAR REFINE TOLERANCE"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsLinearRefineTol)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsLinearRefineTol,Answer)

CASE "CIRCLE APPROXIMATION TOLERANCE"
	stat= SetInputFormat("n4=","")
	A= GetDefault(WsCircleApproxTol)
	stat= SetEqualsValue(A)
	Answer= GetValue(Name$,Answer$)
	IF (ExitScript(Destination$)) THEN Leave
	Stat=SetDefaults(WsCircleApproxTol,Answer)

CASE "CANCEL"
	LowerSelectBox
	 LOAD "typecontrol"
END SELECT

GOTO Start

Leave:!
LowerSelectBox
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
