
! script name: draftedit.d/loccenteron
! topic: turn on/off located center line in a radius or diameter dim.

!A
!A NAME:
!A
!A 	Located center line on/off.
!A
!A DESCRIPTION:
!A
!A	This script turns on the located center line in a radius dimension.
!A
!B INSTRUCTIONS:
!B
!B 	PICK DIMENSION : Pick  the dimension .
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: located center  line on/off ")

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

ActivateUndo
Nocalc=0
Calculate=1
Toggle_sw= 2


Element_loop:!
stat= SetInputFormat("n4","")
E1=PickEntity("PICK DIMENSION ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN Element_loop
E2= ParentDimEnt(E1)
IF NOT ValidGeometry(E2) THEN Element_loop

ActivateUndo
Stat= AdvanceUndoNumber("located center")
Stat= AddDimToUndo(WsUBModifyMode,E2)

Stat=EditDraftSetting(E2,WsLocatedCenter,Toggle_sw,Calculate)

GOTO Element_loop

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