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

!A
!A NAME:
!A
!A 	Line Type Edge	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 edge ")

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

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

Pick_loop:!

E1=WPKPickEntity("PICK EDGE",WsPKPickEdges)
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Pick_loop
Stat= EntityNameCheck(E1,Element$)

Line_type=CurrentLT

WPKClearErrorFlag
RecordFunctionOn
Stat= RecordDescr("ENTITY: line type")
V1= FreeParameter("Line type",Line_type)
Stat= WPKSetLineType(Element$,V1)
PlotOn
RecordFunctionOff
Curr_record= CurrentVarRecord
CloseVarRecord

Stat= WPKSolidRecordOn(Curr_record)
ActivateUndo
Stat= AdvanceUndoNumber("line type entity")
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
