
! script name: ShapeCorp.d/setsplitpoint
! topic: set split point for pre-finish cycle

!A
!A NAME:
!A
!A 	Set pre-finish split point
!A
!A DESCRIPTION:
!A
!A      This script sets a split point for a pre-finish cycle
!A
!A
!B INSTRUCTIONS:
!B
!B 	PICK AN ELEMENT OF CONTOUR: Pick an element on the contour.
!B
!B 	PICK POINT: 
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: set pre-finish split point ")

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


ActivateUndo
Pick_loop:!
Stat= SetInputFormat("n4","")
Contour=PickGroupEnt("PICK ROLL CONTOUR ")
IF (ExitScript(Destination$)) THEN Leave

Stat=Highlight(Contour,WsPickPen,WsDirArrowOff)

Pick_point:!
Stat=SetInputFormat("n4","")
Ploop:Pt=XyzInput("INPUT POINT",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
Stat=SetLastPoint(Pt,WsXyzInput)

E1= GroupElement(Contour,1)
Layer= GetLayer(E1)
Stat= SetLayer(Pt,Layer)
Stat= SetWorkZone(Pt,Layer)
Stat= SetAssembly(Pt,Layer)
Stat= PlotEntity(Pt)

ActivateUndo
Stat= AdvanceUndoNumber("pre-finish split point")
Stat= AddItemToUndo(WsUBCreateMode,Pt)
GOTO Pick_point

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

