
! script name: property.d/tblrowprop
! TOPIC: Create an info packet from a table row

!A
!A NAME:
!A
!A 	Create an Info Packet from a table row
!A
!A DESCRIPTION:
!A
!A 	This creates an info packet from a specific table row.  You can clip
!A 	the information that applies to an entity from a master table and plug
!A 	it in to your geometry in an efficient bundle. Use this feature to
!A 	create streamlined info packets that contain only the information that
!A 	you need, rather than using valuable processing power to crunch numbers
!A 	that you are not going to use.
!A
!# see also - htdocs/help.d/datatables.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: table row packet")

DIM Answer$[256]
DIM A$[256]
DIM Class_name$[256]
DIM Descr$[256]
DIM Element$[256]
DIM Destination$[256]
DEG

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

Name_loop:!
stat= SetInputFormat("a99","")
Stat=GetValue("PACKET CLASS NAME",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Class_name$= Answer$


stat= SetInputFormat("n0","")
Id_number=GetValue("CLASS ID NUMBER",Answer$)
IF (ExitScript(Destination$)) THEN Leave


Pick_loop:!
stat= SetInputFormat("n4","")
Table1=PickEntity("PICK TABLE ROW ")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Table1) THEN Pick_loop
T1= LastPickPara

R1=TableParaRow(Table1,T1)
C1=TableParaColumn(Table1,T1)

E1= TableRowDataString(Table1,R1,":",Class_name$,Id_number)

Stat=OutputUserData(E1,"tempdata",WsNewFile)
Stat=MessageFileBox("tempdata",Class_name$)

GOTO Pick_loop


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

