
! script name: 3dtrim.d/untrim
! var_topic: untrim a surface

!A
!A NAME:
!A
!A 	Untrim a surface entity
!A
!A DESCRIPTION:
!A
!A 	This script removes the trim curves from a surface.
!A
!B INSTRUCTIONS:
!B
!B 	PICK SURFACE: Pick the surface to be untrimmed .
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: untrim surface ")

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

Var_object= CheckVarObject
IF (ExitScript(Destination$)) THEN Leave

ActivateUndo
Start:!
Stat=SetPickMask(WsPickSurfOnly)
Stat=SetInputFormat("n0","")
Surface=PickEntity("PICK SURFACE",Answer$)
IF ExitScript(Destination$) THEN Leave
IF NOT ValidDependency(Surface) THEN Start
Stat= EntityNameCheck(Surface,Surface$)

ActivateUndo
Stat= AdvanceUndoNumber("untrim surface")
Stat= AddItemToUndo(WsUBModifyMode,Surface$)

RecordFunctionOn
Stat= RecordDescr("TRIM: Untrim surface")
Stat=UnTrimEntity(Surface$)
RecordFunctionOff
Curr_record= CurrentVarRecord
CloseVarRecord

Stat= AddItemToUndo(WsUBCreateMode,Curr_record)
GOTO Start

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