
! script name: nurbs.d/splineendpoint
! topic: Sample - modify end point of spline

!A
!A NAME:
!A
!A 	Spline End Point
!A
!A DESCRIPTION:
!A
!A 	This script allows the end point of a spline to be modified.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ELEMENT TO BE CHANGED: Pick an element of the spline closest
!B 		to the end point to be modified.
!B
!B 	INPUT ABS X,Y,Z: Enter the X,Y,Z coordinates of the point.
!B 		NOTE: See XYZ INPUT OPTIONS.
!B
!C NOTE:
!C
!C 	This is an unsupported sample script.
!C
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: spline end point ")

DIM Answer$[256]
DIM Destination$[256]
DEG


DeActivateUndo
Sp=PickEntity("PICK ELEMENT TO BE CHANGED")
IF (ExitScript(Destination$)) THEN Leave

T1= LastPickPara

Spline_loop:Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

IF T1<= 0.5 THEN
	Stat=ChEndPoint(Sp,Pt,WsStart)
ELSE 
	Stat=ChEndPoint(Sp,Pt,WsEnd)
END IF


Stat=SetLastPoint(Pt)
Stat=DeleteEntity(Pt)
GOTO Spline_loop

Leave:!

Stat=DeleteEntity(Pt)
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
