
! script name: pksolids.d/pktaperfaceedges
! solids: apply taper faces adjacent to the faces edges

!A
!A NAME:
!A
!A 	Taper Face Edges
!A
!A DESCRIPTION:
!A
!A 	This script applies taper to the adjacent faces attached to
!A	the selected face. A positive angle will taper faces below
!A	the selected face outward and faces above inward. 
!A	For example, to taper a block, select the top face.
!A
!A
!A~ image location - images/pktaperfaceedges.gif
!B INSTRUCTIONS:
!B
!B	TAPER ANGLE: Input the taper angle.
!B
!B	PICK FACE: Select the face to be used.
!B
!B
!B NOTES:
!B
!B	The taper direction is determined by the positive z axis of
!B	the current workplane.
!B
!B		0,1) PK_taper_method_isocline_c (default)
!B		2)   PK_taper_method_curve_c
!B		3)   PK_taper_method_surface_c
!B		4)   PK_taper_method_offset_c
!B
!B
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: taper face edges")

OPTION BASE 1
DIM Destination$[256]
DIM Answer$[256]

ActivateUndo


Stat= GLPlotOn
Start:!
Method=NamedVarVal("solid taper face method",WsPKSolidsVars,1.0)

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(Angle)
Angle=GetValue("TAPER ANGLE",Answer$)
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4","")
E1=WPKPickEntity("PICK FACE",WsPKPickFace)
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Start

Apply_taper:!
WPKClearErrorFlag
E2= WPKTaperFaceEdges(E1,Angle,Method)

ActivateUndo
Stat= AdvanceUndoNumber("taper face edges")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
GOTO Start


Leave:!
V1=CreateVariable("solid taper face method",WsPKSolidsVars,Method)
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
