
! script name: surfaces.d/surfdensity
! 3dtopic: change plotting density of surface

!A
!A NAME:
!A
!A 	3D Settings: Density
!A
!A DESCRIPTION:
!A
!A 	This script allows the plotting density of a surface to be changed.
!A
!B INSTRUCTIONS:
!B
!B 	PICK SURFACE: Pick the surface to be changed.
!B
!B 	U SECTIONS PLOT DENSITY: Enter the plot density to be used for the
!B 		U sections.
!B
!B 	V SECTIONS PLOT DENSITY: Enter the plot density to be used for the
!B 		V sections.
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: surface plot density ")

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


ActivateUndo
Ask_Density:!
Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(.35)
Plotu=GetValue("U SECTIONS PLOT DENSITY",Answer$)
IF ExitScript(Destination$) THEN Leave

Stat=SetInputFormat("n4=","")
Stat=SetEqualsValue(.35)
Plotv=GetValue("V SECTIONS PLOT DENSITY",Answer$)
IF ExitScript(Destination$) THEN Leave

Pick_surf:!
Stat=SetPickMask(WsPickSurfOnly)
Stat=SetInputFormat("n4a1",",N,")
E1=PickEntity("PICK SURFACE,  New density ",Answer$)
IF ExitScript(Destination$) THEN Leave
IF Answer$= "N" THEN Ask_density
IF NOT ValidGeometry(E1) THEN Pick_surf

Stat=SetPickMask(WsPickGeometry)

ActivateUndo
Stat= AdvanceUndoNumber("density")
Stat= AddItemToUndo(WsUBModifyMode,E1)

Stat=SurfPlotDensity(E1,Plotu,Plotv)

GOTO Pick_surf

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