uses DPSCAD_TLB;
var
ADocument : IPCsDocument;
APage : IPCsPage;
AArcs : IPCsArcs;
AArc : IPCsArc;
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 circles}
AArcs := APage.Arcs;
{get a random circle of the circles in the active page}
AArc := AArcs.Item[Random(AArcs.Count)];
{delete the circle}
AArc.Delete;
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;
var
ADocument : IPCsDocument;
APage : IPCsPage;
AArcs : IPCsArcs;
AArc : IPCsArc;
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 circles}
AArcs := APage.Arcs;
{get a random circle of the circles in the active page}
AArc := AArcs.Item[Random(AArcs.Count)];
{delete the circle}
AArc.Delete;
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;