
! script name: property.d/operatorinfo
! topic: attach a pprint ( operator ) info packet to an entity

!A
!A NAME:
!A
!A 	Attach an Operator Info Packet to an entity
!A
!A DESCRIPTION:
!A
!A 	This script will attach an Operator info packet to a single piece of
!A	Synergy geometry.
!A
!B INSTRUCTIONS:
!B
!# see also - htdocs/help.d/property.htm

Stat=ChangeLabelStr("ScriptNameStatus","Add operator info packet")

DIM Destination$[512]
DIM Answer$[512]
DIM A$[512]
DIM B$[512]
DIM Name$[512]
DIM Prop_dir$[512]
DIM Prop_class$[512]
DIM Current_dir$[512]
DIM Class_dir$[512]
DIM Class_name$[512]
DIM Filename$[512]
DIM Oldname$[512]
DIM D_label$[512]
DIM Sub_label$[512]
DIM F_label$[512]
DIM Choice$[512]
DIM Mask$[32]
DIM Ques$[256]
DIM Line_val$[256]

Stat= NamedVarStr("properties dir",WsSystemVars,"/usr/weber/database/properties/",Prop_dir$)

Start:!

Pick_entity:!
Stat= SetInputFormat("n4","")
E1=PickEntity("PICK ENTITY TO ASSOCIATE WITH OPERATOR INFO")
IF ExitScript(Destination$) THEN Leave

Class_dir$= FileNameString(Prop_dir$,"OperatorInfo")
Filename$= FileNameString(Class_dir$,"template")

Id_number=GetExtUserValue(Filename$,"Class id number:")
P1= ReadUserData(Id_number,"temp",Filename$)

Ask_ques:!
I=1
LOOP
Stat= SetInputFormat("a99","")
Stat= GetValue("ENTER OPERATOR INFORMATION, PROCEED ",Line_val$)
IF ExitScript(Destination$) THEN Leave
EXIT IF Line_val$="PROCEED"
IF I=1 THEN
	A$= Line_val$[1;MIN(15,LEN(Line_val$))]
	Stat= PutUserString(P1,"Name:",A$)
	Stat= ChangeDataName(P1,A$)
END IF
Stat= PutUserString(P1,"Line "&VAL$(I)&":",Line_val$)
I= I+1
END LOOP
IF I= 1 THEN
	Stat= DeleteEntity(P1)
ELSE
	Stat=AssocUserData(E1,P1,Id_number)
	Prop_ent= ResolveDupUserProp(P1)
END IF

GOTO Pick_entity

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


