
! script name: operations.d/newdepths

!A
!A NAME:
!A
!A 	New Operation Finish Depth
!A
!A DESCRIPTION:
!A
!A 	This script allows the finish depth of an operation to be changed.
!A

stat=ChangeLabelStr("ScriptNameStatus","Function: new finish depth")

COM /Ops_var_design/ Use_variational
DIM Destination$[256]
DIM Current_op$[256]

DeActivateUndo
Stat=NamedVarStr("current operation",WsSystemVars,"",Current_op$)
OperData=FindUserData(Current_op$,WsOperation)
IF NOT ValidGeometry(OperData) THEN Leave

Fdepth= GetUserValue(OperData,"Finish depth:")
Stat= SetDepthEquals(Fdepth)
Value= InputDepth("NEW FINISH DEPTH ")
IF ExitScript(Destination$) THEN Leave
Stat= PutUserValue(OperData,"Finish depth:",Value)
IF Fdepth<>Value THEN Stat= PutUserValue(OperData,"Current tool:",1)

Leave:!
Stat= SetInputFormat("n4","")
IF NOT LEN(Destination$) THEN
	Stat= GetUserString(OperData,"Operation script:",Answer$)
	LOAD Answer$
ELSE
	LOAD Destination$
END IF
END
