! script name: contrib/ascript/tsm.d/unlink
! topic: allow a contour to be unlinked
! Version_270423.a

!A
!A NAME:
!A
!A      Unlink Contour
!A
!A DESCRIPTION:
!A
!A      This script allows a contour (one created by Type #'s or one that was
!A      auto linked) to be unlinked.  This means that a contour created with
!A      Type numbers will have the type number association destroyed but the
!A      geometry will remain intact (lines and arcs). If the contour was formed
!A      by an auto link, the geometry remains intact.  Note, this will also
!A      unlink any other group that is associated with this element.
!A
!B INSTRUCTIONS:
!B
!B      PICK ELEMENT TO BE UNLINKED: Pick an element
!B              on the contour to be unlinked.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: unlink contour ")

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


DeActivateUndo
Pick_loop:!
E1=PickEntity("PICK ELEMENT TO BE UNLINKED")
IF (ExitScript(Destination$)) THEN Leave

Stat=Highlight(E1,WsPickPen,WsDirArrowOff)
Stat=UnLink(E1)

GOTO Pick_loop

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