
! script name: 3dtrim.d/expldtrimxyz
! 3dtopic: explode trim curve as an xyz curve

!A
!A NAME:
!A
!A 	Intersect: Trim Curve
!A
!A DESCRIPTION:
!A
!A 	This script will take the trim curves associated with the surface and
!A 	explode them out as contours in XYZ space.  This feature applies to
!A 	3D surfaces only.
!A
!B INSTRUCTIONS:
!B
!B 	PICK TRIM CURVE ON SURFACE: Pick the surface along the trim curve.
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: explode trim curve ")

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

ActivateUndo
Start:!

Intersect2:StdWorkplane

Stat=Setup3dCutter(WsNullTool,0.0,0.0,0.0,0.0,0.0)

Stat=SetPickMask(WsPickSurfOnly)
Stat=SetInputFormat("n0","")
Surface=PickEntity("PICK TRIM CURVE ON SURFACE",Answer$)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(Surface) THEN Intersect2

Which1=LastSurfTrimPick(Surface)

Stat=SetPickMask(WsPickGeometry)

Dir1=WsForward
Group=ExplodeTrimXYZ(Surface,Which1,Dir1)

ActivateUndo
Stat= AdvanceUndoNumber("xyz curve")
Stat= AddGroupToUndo(WsUBCreateMode,Group,1,WsTrue)
GOTO Intersect2

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