
! topic: construct multiple parallel lines
! *************** PARALLEL LINE VARIATION 3 ***************
! 
!    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 parallelvar3
!    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/parallelvar3
!    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, parallelvar3 will construct a line parallel to another
!    line through a specified point.
! 
! script name: lines.d/parallelvar3
! 
!    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, variation 3
!A
!A DESCRIPTION:
!A
!A 	This script allows multiple parallel lines to be created.  When
!A 	the script is first entered the parallel distance will be asked
!A 	and the line to be used as the reference to create the first
!A 	parallel line will be asked.  The parallel line created will
!A 	become the reference for the next parallel line.
!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.  This question will only be asked when the
!B 		script is entered.
!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 ")

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

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

! 
!    The line identifier "Line_loop" has been moved to accomodate the
!    desired change in the new parallel line script.
! 

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

!C
!C If the following line is unremmed the construction will be an untrimmed line.
!C L1=Parallel(E1,Dist,WsUNTRIMMED)
   L1=Parallel(E1,Dist,WsUNTRIMMED)

!C
!C If the following line is unremmed the construction will be a trimmed line.
!C L1=Parallel(E1,Dist,WsTRIMMED)

!C
!C 	The PICK PARALLEL LINE question is only asked when the script is
!C 	entered, therefore the reference line is automatically set to be
!C 	the last parallel line created.
!C

E1=L1
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
