
! script name: points.d/arclenpts
! topic: generate points along contour at equal arc length intervals

!A
!A NAME:
!A
!A 	Equal Arc Length Contour Points
!A
!A DESCRIPTION:
!A
!A 	This script will generate points along a contour at equal arc
!A 	length intervals.
!A
!A~ image location - images/arclenpts.jpg
!B INSTRUCTIONS:
!B
!B 	PICK CONTOUR: Pick the contour to generate the points along.
!B
!B 	NUMBER OF POINTS: Input the number of points.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: equal arc length contour points ")

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


Num_pts= 50

ActivateUndo
Pick_loop:!
Contour=PickGroupEnt("PICK CONTOUR")
IF (ExitScript(Destination$)) THEN Leave

Stat=Highlight(Contour,WsPickPen,WsDirArrowsOff)

stat= SetInputFormat("n0=","")
stat= SetEqualsValue(Num_pts)
Num_pts= GetValue("NUMBER OF POINTS",Answer$)
IF (ExitScript(Destination$)) THEN Leave

Group=ArcLengthPts(Contour,Num_pts)

ActivateUndo
Stat= AdvanceUndoNumber("arclength points")
Stat= AddGroupToUndo(WsUBCreateMode,Group,WsFalse,WsFalse)

stat= DeleteEntity(Group)

GOTO Pick_loop

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