
! script name: draftedit.d/dimscale
! topic: scale dimension output

!A
!A NAME:
!A
!A 	Output Scale Factor
!A
!A DESCRIPTION:
!A
!A 	This script scales the dimension output.
!A
!B INSTRUCTIONS:
!B
!B 	PICK DIMENSION TO BE CHANGED: Pick one of the dimension lines.
!B
!B 	DIMENSION SCALE: Input the new dimension scale.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: dimension scale ")

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

Nocalc=0
Calculate=1

ActivateUndo
Dim_scale= GetDefault(WsDimensionScale)

Dim_scale:stat= SetInputFormat("n4=","")
stat= SetEqualsValue(Dim_scale)
Dim_scale= GetValue("DIMENSION SCALE ")
IF (ExitScript(Destination$)) THEN Leave

Element_loop:!
stat= SetInputFormat("a1",",N,A,")
Element_loop:E1=PickEntity("PICK DIMENSION TO BE CHANGED, New scale , All ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
SELECT Answer$
CASE "N"
        GOTO Dim_scale
CASE "A"
	DeActivateUndo
        Stat=EditDraftSetting(0,WsDimensionScale,Dim_scale,Calculate)
        GOTO Dim_scale
END SELECT
IF NOT ValidGeometry(E1) THEN Element_loop
E2= ParentDimEnt(E1)
IF NOT ValidGeometry(E2) THEN Element_loop

ActivateUndo
Stat= AdvanceUndoNumber("dim scale")
Stat= AddDimToUndo(WsUBModifyMode,E2)

Stat=EditDraftSetting(E2,WsDimensionScale,Dim_scale,Calculate)

GOTO Element_loop

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