uses DPSCAD_TLB;
var
ADocument : IPCsDocument;
APage : IPCsPage;
ALines : IPCsLines;
ALine : IPCsLine;
begin
{check if we're connected to Automation}
if CheckConnection() then // (See function here)
begin
{active project}
ADocument := PCsApplication.ActiveDocument;
{active page}
APage := ADocument.ActivePage;
{all lines}
ALines := APage.Lines;
{get a random line of the lines in the active page}
ALine := ALines.Item[Random(ALines.Count)];
{delete the line}
ALine.Delete;
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;
var
ADocument : IPCsDocument;
APage : IPCsPage;
ALines : IPCsLines;
ALine : IPCsLine;
begin
{check if we're connected to Automation}
if CheckConnection() then // (See function here)
begin
{active project}
ADocument := PCsApplication.ActiveDocument;
{active page}
APage := ADocument.ActivePage;
{all lines}
ALines := APage.Lines;
{get a random line of the lines in the active page}
ALine := ALines.Item[Random(ALines.Count)];
{delete the line}
ALine.Delete;
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;