
! script name: draft.d/explodetext
! topic: input and position line of text

!A
!A NAME:
!A
!A 	Explode Text
!A
!A DESCRIPTION:
!A
!A 	This script allows a line of text to be input and positioned.  The line
!A 	of text will flash on the screen, once a plot, fit, etc. is done the
!A 	text line will remain.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT ABS X,Y,Z: Enter the X,Y,Z coordinates for the position of the
!B 		line of text.  NOTE: See XYZ INPUT OPTIONS.
!B
!B 	INPUT TEXT LINE: Enter the line of text to be output at the selected
!B 		position.
!B
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: explode text ")

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

ActivateUndo
Text_loop:!

Stat=SetInputFormat("n4=","")
Pc=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave


Stat=SetInputFormat("a99","")
Stat=GetValue("INPUT TEXT LINE",Answer$)
IF (ExitScript(Destination$)) THEN Leave

T1=TextLine(Pc,Answer$)
Grp1= ExplodeText(T1)

Stat=DeleteEntity(Pc)
Stat=DeleteEntity(T1)
Stat=DeleteEntity(Grp1)

ActivateUndo
Stat= AdvanceUndoNumber("explode text")
Stat= AddGroupToUndo(WsUBCreateMode,Group,WsTrue,WsFalse)

GOTO Text_loop

Leave:!
Stat=DeleteEntity(Pc)
Stat=DeleteEntity(T1)
Stat=DeleteEntity(Grp1)
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
