
! script name: 3dcpaths.d/shownormals
! 3DTOPIC: show group surface normals.

!A
!A NAME:
!A
!A 	Show surface group normals.
!A
!A DESCRIPTION:
!A
!B INSTRUCTIONS:
!B
!B 	PICK SURFACE GROUP:	Pick the group of surfaces.
!B
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: show surface normals ")

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

DeActivateUndo
Normal_len=NamedVarVal("3D Normal Length",Ws3DSystemVars,1.0)
Normal_color=3
Wide_line=10

Start:!

Stat=SetPickMask(WsPickSurfOnly)
Stat=SetInputFormat("a1",",P,")
Part_group=PickGroupEnt("PICK SURFACE GROUP",0)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(Part_group) THEN Start

Stat= ShowGroupNormals(Part_group,Normal_len,Normal_color,Wide_line)
!Num_surfs=GroupCount(Part_group)
!FOR I=1 TO Num_surfs
!   surf1=GroupElement(Part_group,I)
!   IF ValidGeometry(Surf1) THEN
!	Sw= IsEntVisible(surf1)
!	IF Sw= WsTrue THEN
!		PlotOff
!		Uvpoint= ValidUVPoint(Surf1,0.5,0.5)
!		U= XPointValue(Uvpoint)
!		V= YPointValue(Uvpoint)
!		Stat= DeleteEntity(Uvpoint)
!		PlotOn
!        	Stat= ShowSurfNormal(Surf1,U,V,Normal_len,Normal_color,Wide_line)
!	END IF
!   END IF
!NEXT I
GOTO Start

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