
! script name: 3druled.d/ruledcontour
! 3dtopic: explodes the contour  in a ruled surface

!A
!A NAME:
!A
!A 	Ruled contour
!A
!A DESCRIPTION:
!A
!A 	This script will explode the contour in a ruled surface.
!A
!B INSTRUCTIONS:
!B
!B 	PICK RULED SURFACE: Pick the ruled surface.
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: ruled contour contour ")

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

ActivateUndo
Sloop:!
S1=PickEntity("PICK SURFACE")
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(S1) THEN Sloop

UVpoint=LastUVSurfPick(S1)
IF NOT ValidGeometry(UVpoint) THEN Sloop
U=XPointValue(UVpoint)
V=YPointValue(UVpoint)
Stat= DeleteEntity(UVPoint)

Which_one=1
IF V > 0.51 THEN Which_one= 2
Contour= RuledContour(S1,Which_one)

ActivateUndo
Stat= AdvanceUndoNumber("ruled contour")
Stat= AddGroupToUndo(WsUBCreateMode,Contour,1,WsTrue)
GOTO Sloop

Leave:!

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