-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathList Previs Roots.pas
More file actions
60 lines (50 loc) · 1.46 KB
/
List Previs Roots.pas
File metadata and controls
60 lines (50 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
Lists the PreVis roots of the cells it is run on
}
unit userscript;
uses praUtil;
var
list: TStringList;
procedure outputCell(cell: IInterface);
begin
AddMessage(IntToHex(FormID(cell), 8)+' '+DisplayName(cell));
end;
// Called before processing
// You can remove it if script doesn't require initialization code
function Initialize: integer;
begin
list := TStringList.create();
Result := 0;
end;
// called for every record selected in xEdit
function Process(e: IInterface): integer;
var
rvis: IInterface;
str: string;
begin
Result := 0;
// comment this out if you don't want those messages
if(Signature(e) <> 'CELL') then exit;
rvis := pathLinksTo(e, 'RVIS');
if(assigned(rvis)) then begin
str := IntToHex(FormID(rvis), 8);
if(list.indexOf(str) < 0) then begin
list.addObject(str, rvis);
end;
end;
end;
// Called after processing
// You can remove it if script doesn't require finalization code
function Finalize: integer;
var
i: integer;
kw: IInterface;
begin
for i:=0 to list.count-1 do begin
kw := ObjectToElement(list.Objects[i]);
outputCell(kw);
end;
Result := 0;
list.free();
end;
end.