
! script name: lines.d/sptangleline
! topic: construct line in 3D space through a point at angle to a line

!A
!A NAME:
!A
!A 	3D Pt: Angle: Line
!A
!A DESCRIPTION:
!A
!A 	This script constructs a line in 3D space through a point at a
!A 	specified angle to another line.  The other line has already been
!A 	defined.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT ABS X,Y,Z: Enter the X,Y,Z coordinates of the point in
!B 		3D space, through which the line will be constructed at a
!B 		specified angle to another line.  NOTE: See XYZ INPUT OPTIONS.
!B
!B 	ANGLE OF LINE: Enter the angle of the line to be constructed,
!B 		referenced from an already defined line.
!B
!B 	PICK LINE: Pick the line to be used as the reference for the
!B 		specified angle.
!B
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: 3d pt: angle: line ")

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

DEG
ActivateUndo
Line_loop:!
stat= SetInputFormat("n4","")
Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave

Angle=InputAngle("ANGLE OF LINE")
IF (ExitScript(Destination$)) THEN Leave

L1=PickSpecificEnt("PICK LINE",WsPickLines)
IF (ExitScript(Destination$)) THEN Leave

Ln1=SpacePtLineAng(Pt,Angle,L1,WsTRIMMED)

Stat=DeleteEntity(Pt)
ActivateUndo
Stat= AdvanceUndoNumber("line")
Stat= AddItemToUndo(WsUBCreateMode,Ln1)
GOTO Line_loop

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