uses DPSCAD_TLB;
var
ADocument : IPCsPage;
RandomPage : integer;
begin
{check if we're connected to Automation}
if CheckConnection() then // (See function here)
begin
{active project}
ADocument := PCsApplication.ActiveDocument;
{a random page in active document}
RandomPage := Random(ADocument.Drawing.Pages.Count);
{delete the page}
ADocument.Drawing.Pages[RandomPage].Delete;
end;
end;
var
ADocument : IPCsPage;
RandomPage : integer;
begin
{check if we're connected to Automation}
if CheckConnection() then // (See function here)
begin
{active project}
ADocument := PCsApplication.ActiveDocument;
{a random page in active document}
RandomPage := Random(ADocument.Drawing.Pages.Count);
{delete the page}
ADocument.Drawing.Pages[RandomPage].Delete;
end;
end;