
! script name: pkattributes.d/vpklinetypebody
! var_solids: assign line type to the edges in a solid body

!A
!A NAME:
!A
!A 	Line Type Body Edges	VARIATIONAL
!A
!A DESCRIPTION:
!A
!A 	This script assigns linetypes to the edges in a solid body.
!A
!B INSTRUCTIONS:
!B
!B 	PICK BODY : Pick the element that will be assigned a line type.
!B
!# see also - htdocs/help.d/pkgroups.htm
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: line type group ")

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

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


Pick_loop:!
E1=WPKPickEntity("PICK BODY")
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Pick_loop

Line_type=CurrentLT
Pkbody= WPKParentBody(E1)
Stat= EntityNameCheck(Pkbody,Body$)

WPKClearErrorFlag
RecordFunctionOn
Stat= RecordDescr("BODY: linetype edges")
V1= FreeParameter("Line type",Line_type)
Stat= WPKSetLineType(Body$,V1)
PlotOn
RecordFunctionOff
Curr_record= CurrentVarRecord
CloseVarRecord


Stat= WPKSolidRecordOn(Curr_record)
ActivateUndo
Stat= AdvanceUndoNumber("line type body")
Stat= AddItemToUndo(WsUBPKSessionMark)
Stat= AddItemToUndo(WsUBCreateMode,Curr_record)
WPKErrorCheck

GOTO Pick_loop

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