
! script name: subassembly.d/subassemblygrp
! topic: assign contours to sub-assembly

!A
!A NAME:
!A
!A 	SubAssembly Contour
!A
!A DESCRIPTION:
!A
!A 	This script allows contours to be assigned to different sub-assembly.
!A
!B INSTRUCTIONS:
!B
!B 	SUB-ASSEMBLY NUMBER,   current subassembly= # : Enter the sub-assembly
!B		number to be assigned to the element selected.
!B
!B 	PICK CONTOUR TO BE ASSIGNED SUB-ASSEMBLY # : Pick the contour that is
!B 		to be assigned to the sub-assembly selected.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: sub-assembly contour ")

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

ActivateUndo
SubAssembly=CurrSubAssembly

Start:!
Stat= SetInputFormat("n0a99","")
SubAssembly=InputSubAssembly("SUB-ASSEMBLY NUMBER, current subassembly= "&VAL$(SubAssembly),Answer$)
IF (ExitScript(Destination$)) THEN Leave

Ploop:!
E1=PickGroupEnt("PICK ELEMENT TO BE ASSIGNED SUB-ASSEMBLY "&VAL$(SubAssembly))
IF ExitScript(Destination$) THEN Leave

ActivateUndo
Stat= AdvanceUndoNumber("set sub assembly")
Stat= AddGroupToUndo(WsUBModifyMode,E1,1,WsTrue)

Stat=SetSubAssembly(E1,SubAssembly)

GOTO Ploop

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