
! script name: points.d/intersect
! topic: create point at intersection of two elements

!A
!A NAME:
!A
!A 	Intersection
!A
!A DESCRIPTION:
!A
!A 	This script creates a point at the intersection of two elements.
!A
!A~ image location - images/intersectpt.jpg
!B INSTRUCTIONS:
!B
!B 	PICK FIRST ELEMENT OF INTERSECTION: Pick one of the elements that
!B 		is to be used to determine the point location.
!B
!B 	PICK SECOND ELEMENT OF INTERSECTION: Pick the other element that
!B 		intersects the first element picked.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: intersection ")

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


DEG

ActivateUndo
Stat=SetXyzInput(WsIntersect)
Ploop:Pt=XyzInput("INPUT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Pt) THEN Ploop

Stat=SetLastPoint(Pt,WsXyzInput)

ActivateUndo
Stat= AdvanceUndoNumber("point")
Stat= AddItemToUndo(WsUBCreateMode,Pt)
GOTO Ploop

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