
! script name: points.d/yentity
! topic: create point on entity at known Y

!A
!A NAME:
!A
!A 	Element and Y Value
!A
!A DESCRIPTION:
!A
!A 	This script creates a point on an entity at a known Y.
!A
!A~ image location - images/yentity.jpg
!B INSTRUCTIONS:
!B
!B 	INPUT ABS Y: Enter the Y coordinate of the point.
!B 
!B 	PICK INTERSECTING ELEMENT: Pick the element that intersects
!B 		the Y coordinate of the point.
!B

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

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


DEG

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

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
