
! script name: vdraftedit.d/ dimlinebreak
! var_topic: insert a line break symbol in a dimension line.

!A
!A NAME:
!A
!A 	Dim Line Break		VARIATIONAL
!A
!A DESCRIPTION:
!A
!A	This script replaces a dimline with a line break symbol.
!A
!B INSTRUCTIONS:
!B
!B 	PICK DIMENSION LINE: Pick the dimension line
!B 		to be replaced with a break symbol.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: dim line on ")

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

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

ActivateUndo
Height1= 3.0*GetDefault(WsTextHeight)
Length1= 3.0*GetDefault(WsTextWidth)
Space1= 0.0


Element_loop:!
stat= SetInputFormat("n4","")
E1=PickEntity("PICK DIMENSION LINE ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidDependency(E1) THEN Element_loop
Stat= EntityNameCheck(E1,Element$)
Para1= LastPickPara


Stat= EraseEntity(E1)
E2= ParentDimEnt(E1)
Stat= EraseEntity(E2)

ActivateUndo
Stat= AdvanceUndoNumber("dim line break")
Stat= AddItemToUndo(WsUBModifyMode,Element$)

RecordFunctionOn
Stat= RecordDescr("DIMENSION: Dim line break")
V1= FreeParameter("Break length ",Length1)
V2= FreeParameter("Break height ",Height1)
V3= FreeParameter("Break spacing ",Space1)
V4= FreeParameter("Break Para ",Para1)
C1= LineBreak(Element$,V1,V2,V4,V3)
Stat= SwapEntityData(Element$,C1)
Stat= DeleteEntityList(Ps,Pe,Pt,C1)
RecordFunctionOff
Curr_record= CurrentVarRecord
CloseVarRecord

Stat= AddItemToUndo(WsUBCreateMode,Curr_record)

Stat= PlotEntity(E1)
E2= ParentDimEnt(E1)
Stat= PlotEntity(E2)
GOTO Element_loop

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