
! script name: trim.d/trim
! topic: trim element

!A
!A NAME:
!A
!A 	Trim Element
!A
!A DESCRIPTION:
!A
!A 	This script allows an element to be trimmed to the
!A 	intersection with another element. For lines and circles
!A	non intersecting elements will be extended to the intersection.
!A
!A~ image location - images/elementtrim.jpg
!B INSTRUCTIONS:
!B
!B 	PICK ELEMENT TO BE TRIMMED: Pick the element that is to be trimmed.
!B
!B 	PICK TRIMMING ELEMENT: Pick the element that is the determining
!B 		factor in trimming the other element.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: trim element ")

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


DEG

Input_methodr= CurrInputMethod
Stat=SetXyzInput(WsTrimEntity)
ActivateUndo

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

GOTO Ploop

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