uses DPSCAD_TLB;
var
ADocument : IPCsDocument;
APage : IPCsPage;
AArcs : IPCsArcs;
AArc : IPCsArc;
PosX, PosY, PosZ : integer;
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)];
{get position of that circle}
AArc.GetPosition(PosX,PosY,PosZ);
{modify the position of that circle}
PosX := PosX + 10000;
PosY := PosY + 10000;
{update the circle with the new positions and new radius}
AArc.SetPosition(PosX,PosY,PosZ);
AArc.Radius := 7000;
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;
var
ADocument : IPCsDocument;
APage : IPCsPage;
AArcs : IPCsArcs;
AArc : IPCsArc;
PosX, PosY, PosZ : integer;
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)];
{get position of that circle}
AArc.GetPosition(PosX,PosY,PosZ);
{modify the position of that circle}
PosX := PosX + 10000;
PosY := PosY + 10000;
{update the circle with the new positions and new radius}
AArc.SetPosition(PosX,PosY,PosZ);
AArc.Radius := 7000;
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;