
! script name: points.d/xyincr
! topic: create point using INCREMENTAL XY input mode as default

!A
!A NAME:
!A
!A 	Incremental XY
!A
!A DESCRIPTION:
!A
!A 	This script creates points using the Incremental XY input mode.
!A 	Incremental XY provides an easy way of placing multiple points of
!A 	increasing value.  Synergy will first ask you to place the base point,
!A 	and then you will enter data in a series of consecutive additions.
!A 	Synergy does not create a point at the base point.
!A
!A~ image location - images/incrementalxy.jpg
!B INSTRUCTIONS:
!B
!B	INPUT BASE POINT:  Input the base point for the incremental
!B		point description. Note no point is created here.
!B
!B 	INPUT INCREMENTAL  X,Y,: Enter the X,Y coordinates of the
!B 		point.  NOTE: See XYZ INPUT OPTIONS.
!B
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: incremental xy point ")

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


DEG
ActivateUndo
Base_point:Stat=SetInputFormat("n4","")
Stat= SetAbsIncrInput(WsAbsolute)
Stat=SetXyzInput(WsXyzInput)
Base_point=XyzInput("BASE POINT",WsXyOnly)
IF (ExitScript(Destination$)) THEN Leave
Stat=SetLastPoint(Base_point,WsXyOnly)
Stat=SetXyzInput(WsXyzInput)

Stat= SetAbsIncrInput(WsIncremental)
Ploop:!
Stat=SetInputFormat("n4","")
Ploop:Pt=XyzInput("INPUT",WsXyOnly)
IF (ExitScript(Destination$)) THEN Leave

Stat=SetLastPoint(Pt,WsXyOnly)
ActivateUndo
Stat= AdvanceUndoNumber("point")
Stat= AddItemToUndo(WsUBCreateMode,Pt)
GOTO Ploop

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