
! script name: edit.d/entityendpoint
! topic: edit coordinates of an element end point

!A
!A NAME:
!A
!A 	Entity End Point
!A
!A DESCRIPTION:
!A
!A 	This script allows the coordinates of an element end point to be
!A 	modified.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ELEMENT TO BE CHANGED: Pick the element near the end point
!B 		that is to be modified.
!B
!B 	INPUT NEW ABS X,Y: Enter the X,Y coordinates of the new end point
!B 		location.  NOTE: See XYZ INPUT OPTIONS.
!B
!# see also - points.d/xyzinput.hlp

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

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


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

T1=LastPickPara

IF (T1<=0.5) THEN
	Which_end=WsStart
ELSE
	Which_end=WsEnd
END IF

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

Stat=ChEndPoint(E1,Pt,Which_end)


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

Leave:!

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