
! script name: parasolids.d/faceentintersect
! solids: find the intersection between a face and an entity

!A
!A NAME:
!A
!A 	Face with Entity
!A
!A DESCRIPTION:
!A
!A 	This script finds the intersect points between an entity and a face.
!A
!B INSTRUCTIONS:
!B
!B 	PICK FACE: Pick the target face.
!B
!B 	PICK ENTITY: Pick a synergy entity.
!B
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: face entity intersect ")

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

ActivateUndo

Stat= GLPlotOn
Face_loop:!
E1=WPKPickEntity("PICK FACE",WsPKPickFace)
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Face_loop

Pick_entity:!
E2=PickEntity("PICK ENTITY ")
IF (ExitScript(Destination$)) THEN Leave

WPKClearErrorFlag
Group= WPKFaceCurveInter(E1,E2)

ActivateUndo
Stat= AdvanceUndoNumber("face ent intersect")
Stat= AddGroupToUndo(WsUBCreateMode,Group,0,WsFalse)
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
Stat= DeleteEntity(Group)

GOTO Face_loop

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