
! script name: 3dintersect.d/partedges
! 3dtopic: generates a curve along all edges of the part

!A
!A NAME:
!A
!A 	Intersect: Part Edges
!A
!A DESCRIPTION:
!A
!A 	This script generates a curve along all edges in a group of surfaces.
!A
!B INSTRUCTIONS:
!B	
!B	PICK SURFACE: Pick the surface.
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: four edges ")

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

Tol=NamedVarVal("3D Intersect Tol",Ws3DSystemVars,0.005)

ActivateUndo
Start:!
StdWorkplane
Stat=Setup3dCutter(WsNullTool,0.0,0.0,0.0,0.0,0.0)

Pick_loop:!

Intersect2:!
Stat=SetPickMask(WsPickSurfOnly)
Stat=SetInputFormat("n4","")
Part_group=PickGroupEnt("PICK SURFACE GROUP ",WsSurfaceGroup)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(Part_group) THEN Intersect2

Stat=Highlight(Part_group,WsPickPen,WsDirArrowOff)
Stat=SetPickMask(WsPickGeometry)

Group= PartEdges(Part_group,tol)

ActivateUndo
Stat= AdvanceUndoNumber("edge curves")
Stat= AddGroupToUndo(WsUBCreateMode,Group,1,WsTrue)

GOTO Intersect2

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