
! topic: construct line parallel at specified perpendicular distance

! *************** PARALLEL LINE VARIATION 1 ***************
! 
!    To modify a SYNERGY script, the first item is to copy (cp) the original
!    script to another location with a new name ( 14 character limit ).  For
!    example, it might be called parallelvar1
!    To prevent confusion, change the  name of the script in the new script.
!    The name at the top of the original script is:
!        script name: lines.d/parallel
!    Change this line to read:
!        script name: lines.d/parallelvar1
!    The name must also be added to the directory.
!    The original SYNERGY script constructs a line parallel to another line
!    at a specified perpendicular distance, the perpendicular distance
!    question is asked in each question sequence.
!    The new script, parallelvar1 will construct a line parallel to another
!    line at a specified perpendicular distance, but the perpendicular 
!    distance question is only asked once when the script is entered.
! 
! script name: lines.d/parallelvar1
! 
!    The help file should be modified to accomodate the changes made to the
!    script.  ( If someone, other than the author of the modified script,
!    accesses the script, they will still be able to receive help. )
! 
!A
!A NAME:
!A
!A 	Parallel Line, option 1
!A
!A DESCRIPTION:
!A
!A 	This script constructs a line parallel to another line at a specified
!A 	perpendicular distance.
!A
!B INSTRUCTIONS:
!B
!B 	PARALLEL DISTANCE: The perpendicular distance between the original
!B 		line and the line that will be constructed parallel to it.
!B              This question will only be asked when the script is entered.
!B
!B 	PICK PARALLEL LINE: Pick the line referenced for the parallel distance.
!B 		This line has already been described.  It cannot be described
!B 		in this script.
!B
!B 	PICK LEFT/RIGHT OF LINE: This indicates the side the parallel line
!B 		will be constructed on.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: parallel line, option 1 ")

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

DEG

ActivateUndo
Distr=NamedVarVal("parallel distance",WsSystemVars,.25)

Stat=SetEqualsValue(Distr)
Stat=SetInputFormat("n4=","")

Distance=GetValue("PARALLEL DISTANCE",Answer$)
IF (ExitScript(Destination$)) THEN Leave

Distr=Distance

! 
!    The line identifier "Line_loop" has been moved to accomodate the desired
!    change in the new parallel line script.  There have been no other
!    changes to the actual code.
! 

Line_loop: !

E1=PickSpecificEnt("PICK PARALLEL LINE",WsPickLines)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN Line_loop

Pt=InputFreePoint("PICK LEFT/RIGHT OF LINE")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Pt) THEN Line_loop

S1=PtLeftRight(E1,Pt)

Dist=S1*Distance

L1=Parallel(E1,Dist,WsUNTRIMMED)


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

Leave:!
Vdist=CreateVariable("parallel distance",WsSystemVars,Distr)

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