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

!A
!A NAME:
!A
!A 	Incremental XYZ
!A
!A DESCRIPTION:
!A
!A 	This script creates points using the Incremental XYZ INPUT.
!A
!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,Z: Enter the X,Y,Z coordinates of the
!B 		point.  NOTE: See XYZ INPUT OPTIONS.
!B
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: incremental xyz 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",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
Stat=SetLastPoint(Base_point,WsXyzInput)
Stat=SetXyzInput(WsXyzInput)

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

Stat=SetLastPoint(Pt)
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
