uses DPSCAD_TLB;
var
ADocument : IPCsDocument;
APage : IPCsPage;
ASymbols : IPCsSymbols;
ASymbol : IPCsSymbol;
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 symbols}
ASymbols := APage.Symbols;
{get a random symbol of the symbols in the active page}
ASymbol := ASymbols.Item[Random(ASymbols.Count)];
{get position of that Symbol}
ASymbol.GetPosition(PosX,PosY,PosZ);
{modify the position of that Symbol}
PosX := PosX + 40000;
PosY := PosY + 30000;
{update the Symbol with the new positions and new text}
ASymbol.SetPosition(PosX,PosY,PosZ);
ASymbol.FullName := 'New Symbolname';
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;
var
ADocument : IPCsDocument;
APage : IPCsPage;
ASymbols : IPCsSymbols;
ASymbol : IPCsSymbol;
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 symbols}
ASymbols := APage.Symbols;
{get a random symbol of the symbols in the active page}
ASymbol := ASymbols.Item[Random(ASymbols.Count)];
{get position of that Symbol}
ASymbol.GetPosition(PosX,PosY,PosZ);
{modify the position of that Symbol}
PosX := PosX + 40000;
PosY := PosY + 30000;
{update the Symbol with the new positions and new text}
ASymbol.SetPosition(PosX,PosY,PosZ);
ASymbol.FullName := 'New Symbolname';
{update drawing in Automation through IPCsApplication}
PCsApplication.Redraw;
end;
end;