
! script name: draftedit.d/splitextlines
! topic: split extension lines around text.

!A
!A NAME:
!A
!A 	Split Extension Lines
!A
!A DESCRIPTION:
!A
!A 	This script will split the extension lines around the text and
!A 	arrows for two dimensions. If the two dimensions do not
!A 	interfere then nothing will happen.
!A
!A~ image location - images/splitext.gif
!A
!B INSTRUCTIONS:
!B
!B 	PICK FIRST DIMENSION : Pick one of the dimension lines
!B 		near the dimension that is to be modified.
!B
!B 	PICK SECOND DIMENSION : Pick one of the dimension lines
!B 		near the dimension that is to be modified.
!B
!C NOTE:
!C
!C 	This script is useful for situations in which a dimension text
!C 	overlaps an extension line or when an extension line is to close
!C 	to an arrowhead. It may also be used to trim a dimension line
!C 	around a Geometric Tolerance Feature Box, when the feature
!C 	box is to be placed directly below a vertical dimension.
!C
!C 	This script does not distinguish between extension lines and
!C 	dimension lines. It will split both kind of lines. The standard
!C 	says that dimension lines are never split.
!C 	This script only works on dimensions created in Synergy which
!C 	have not been unlinked. Lines and Text which result from
!C 	unlinking dimensions or importing from IGES are not
!C 	not structured in a way that allows this script to operate.
!C
!C 	Circles and BSplines, used in Angular dimensions
!C 	and in Balloon Notes, are not split.
!C

stat=ChangeLabelStr("ScriptNameStatus","Function: split extension lines ")

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


DeActivateUndo
Element_loop:!
stat= SetInputFormat("n4","")

Element_loop:E1=PickEntity("PICK FIRST DIMENSION")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN Element_loop
Diment1= ParentDimEnt(E1)
IF NOT ValidGeometry(Diment1) THEN Element_loop

E1=PickEntity("PICK SECOND DIMENSION")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(E1) THEN Element_loop
Diment2= ParentDimEnt(E1)
IF NOT ValidGeometry(Diment2) THEN Element_loop

Stat= EraseEntity(diment1)
Stat= EraseEntity(diment2)
PlotOff
Stat= SplitDimExtLines(diment1,diment2)
Stat= SplitDimExtLines(diment2,diment1)
PlotOn
Stat= PlotEntity(diment1)
Stat= PlotEntity(diment2)

GOTO Element_loop

Leave:!
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END


