
! script name: draftedit.d/dimextlinegap
! topic: create a gap in an extension line

!A
!A NAME:
!A
!A 	Make Ext Line Gap
!A
!A DESCRIPTION:
!A
!A 	This script will create a gap in an extension line.
!A
!B INSTRUCTIONS:
!B
!B 	PICK DIMENSION : Pick the dimension line to be split.
!B
!B 	START POINT : Pick the start point of the gap.
!B
!B 	END POINT : Pick the end point of the gap.
!B
!C NOTE:
!C
!C 	Be careful of multiple extension lines on top of one another.
!C 	This function will only split the line for the particular dimension
!C 	picked. It will not split not dimension lines.
!C
!C 	Circles and BSplines, used in Angular dimensions
!C 	and in Balloon Notes, are not split.
!C

stat=ChangeLabelStr("ScriptNameStatus","Function: extension line gap")

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


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

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

stat= SetInputFormat("n4","")
First_point:Ps=XyzInput("STARTING",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Ps) THEN First_point

Stat=SetLastPoint(Ps)
Pe=XyzInput("ENDING",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Pe) THEN First_point


Stat= EraseEntity(diment)
PlotOff
Stat= PointSplitExtLines(diment,ps,pe)
PlotOn
Stat= DeleteEntity(ps)
Stat= DeleteEntity(pe)
Stat= PlotEntity(diment)

GOTO Element_loop

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


