
! script name: points.d/yangle
! topic: create point at absolute Y location and angle

!A
!A NAME:
!A
!A 	Angle and Y Value
!A
!A DESCRIPTION:
!A
!A 	This script creates a point at an absolute Y location and an angle.
!A 	The angle is referenced from the base point.
!A
!A~ image location - images/yangle.jpg
!B INSTRUCTIONS:
!B
!B 	INPUT ABS Y: Enter the Y coordinate of the point.
!B
!B 	INPUT ANGLE: Enter the angular orientation of the point to be created.
!B 		The base point is used as the reference for the angle.
!B
!B 	INPUT ABS Z: Enter the Z coordinate of the point.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: y: angle ")

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=SetXyzInput(WsAngleEntity)
Stat= DeleteEntity(Base_point,WsFalse)


Stat=SetXyzInput(WsYandAngle)
Ploop:Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

Stat=SetLastPoint(Pt,WsXyzInput)
ActivateUndo
Stat= AdvanceUndoNumber("point")
Stat= AddItemToUndo(WsUBCreateMode,Pt)
GOTO Base_point

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