
! script name: vdraftedit.d/arrowstyle
! var_topic: edit arrowhead style in a dimension

!A
!A NAME:
!A
!A 	CHANGE ARROWHEAD STYLE   VARIATIONAL
!A
!A DESCRIPTION:
!A
!A 	This script changes the arrowhead style in a dimension.
!A
!B INSTRUCTIONS:
!B
!B 	PICK DIMENSION TO BE CHANGED: Pick one of the dimension lines.
!B
!B 	ARROWHEAD STYLE: Enter the new style number.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: arrowhead style ")

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

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

Nocalc=0
Calculate=1

ActivateUndo
Style= GetDefault(WsArrowStyle)

Style:stat= SetInputFormat("n0=","")
stat= SetEqualsValue(Style)
Style= GetValue("ARROWHEAD STYLE ")
IF (ExitScript(Destination$)) THEN Leave


Element_loop:!
stat= SetInputFormat("a1",",N,")
E1=PickEntity("PICK DIMENSION TO BE CHANGED, New style ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$="N" THEN Style
IF NOT ValidGeometry(E1) THEN Element_loop
E2= ParentDimEnt(E1)
IF NOT ValidDependency(E2) THEN Element_loop
Stat= EntityNameCheck(E2,Element$)

ActivateUndo
Stat= AdvanceUndoNumber("arrow style")
Stat= AddDimToUndo(WsUBModifyMode,Element$)

RecordFunctionOn
Stat= RecordDescr("ARROW: Style")
V1= FreeParameter("Arrow style",Style)
Stat=EditDraftSetting(Element$,WsArrowStyle,V1,Calculate)
RecordFunctionOff
Curr_record= CurrentVarRecord
CloseVarRecord

Stat= AddItemToUndo(WsUBCreateMode,Curr_record)
GOTO Element_loop

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