
! script name: nurbs.d/convtobspline
! topic: convert entity to nurb curve

!A
!A NAME:
!A
!A 	Convert to Nurbs
!A
!A DESCRIPTION:
!A
!A 	This script allows an entity to be converted to a NURBS curve.
!A 	The curve created will have control points that may be edited.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ELEMENT TO BE CONVERTED: Pick the element to be converted
!B 		to a NURBS curve.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: convert to nurbs ")

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


ActivateUndo
Ploop:!
E1=PickEntity("PICK ELEMENT TO BE CONVERTED")
IF (ExitScript(Destination$)) THEN Leave

Bspline=ConvToBSpline(E1)

ActivateUndo
Stat= AdvanceUndoNumber("nurb curve")
Stat= AddItemToUndo(WsUBCreateMode,Bspline)

GOTO Ploop

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