uses DPSCAD_TLB;
Type
TTermDataType = (td_ExtComp, td_ExtWireNo, td_ExtCable, td_ExtSignal, td_OutConn, td_InConn, td_InSignal, td_InCable, td_InWireNo, td_InComp, td_JumperLink);
var
PCsApplication : IPCsApplication;
ListOfTerminals : IPCsList;
TerminalName, ConnectedToInput, ConnectedToOutput, CablesToInput, CablesToOutput, WireToInput, WireToOutput : IPCsSymbol;
IndexTerm, i, OutInt : integer
EmptyString : string;
begin
{check if we're connected to Automation}
if CheckConnection() then // (See function here)
begin
{create a IPCsList of all terminals in correct active project}
ListOfTerminals := PCsApplication.ActiveDocument.Drawing.Lists.CreateTerminalList(EmptyString);
{running through every item in IPCsList}
for i := 0 to ListOfTerminals.Count - 1 do
with ListOfTerminals.Item[i] do
begin
{fills different Symbol-variables, with information, that shows a symbols connection to other symbols}
{td_InConn, is used for getting name of Terminal, and gives symbol to TerminalName}
GetDataSymbol(integer(td_InConn),0,TerminalName,IndexTerm);
{td_InComp, which termnial is it connected to (input), and gives symbol to ConnectedToInput}
GetDataSymbol(integer(td_InComp),0,ConnectedToInput,IndexTermInput);
{td_ExtComp, which termnial is it connected to (output), and gives symbol to ConnectedtoOutput}
GetDataSymbol(integer(td_ExtComp),0,ConnectedToOutput,IndexTermOutput);
{td_InCable, what is the name of the cable (input), and gives symbol to CablesToInput}
GetDataSymbol(integer(td_InCable),0,CablesToInput,IndexCableInput);
{td_InCable, what is the name of the cable (output), and gives symbol to CablesToOutput}
GetDataSymbol(integer(td_ExtCable),0,CablesToOutput,IndexCableOutput);
{td_InWireNo, what is the name of the WireNo (input)}
GetDataSymbol(integer(td_InWireNo),0,WireToInput,IndexWireInput);
{td_ExtWireNo, what is the name of the WireNo (ouput)}
GetDataSymbol(integer(td_ExtWireNo),0,WireToOutput,IndexWireOutput);
{td_JumperLink, shows if there a bridge on this terminal}
{if OutInt is not 0 then there is, and it's connected to all other}
{terminals that returns the same number as OutInt is}
GetDataInteger(integer(td_JumperLink),0,OutInt);
end;
end;
end;
Type
TTermDataType = (td_ExtComp, td_ExtWireNo, td_ExtCable, td_ExtSignal, td_OutConn, td_InConn, td_InSignal, td_InCable, td_InWireNo, td_InComp, td_JumperLink);
var
PCsApplication : IPCsApplication;
ListOfTerminals : IPCsList;
TerminalName, ConnectedToInput, ConnectedToOutput, CablesToInput, CablesToOutput, WireToInput, WireToOutput : IPCsSymbol;
IndexTerm, i, OutInt : integer
EmptyString : string;
begin
{check if we're connected to Automation}
if CheckConnection() then // (See function here)
begin
{create a IPCsList of all terminals in correct active project}
ListOfTerminals := PCsApplication.ActiveDocument.Drawing.Lists.CreateTerminalList(EmptyString);
{running through every item in IPCsList}
for i := 0 to ListOfTerminals.Count - 1 do
with ListOfTerminals.Item[i] do
begin
{fills different Symbol-variables, with information, that shows a symbols connection to other symbols}
{td_InConn, is used for getting name of Terminal, and gives symbol to TerminalName}
GetDataSymbol(integer(td_InConn),0,TerminalName,IndexTerm);
{td_InComp, which termnial is it connected to (input), and gives symbol to ConnectedToInput}
GetDataSymbol(integer(td_InComp),0,ConnectedToInput,IndexTermInput);
{td_ExtComp, which termnial is it connected to (output), and gives symbol to ConnectedtoOutput}
GetDataSymbol(integer(td_ExtComp),0,ConnectedToOutput,IndexTermOutput);
{td_InCable, what is the name of the cable (input), and gives symbol to CablesToInput}
GetDataSymbol(integer(td_InCable),0,CablesToInput,IndexCableInput);
{td_InCable, what is the name of the cable (output), and gives symbol to CablesToOutput}
GetDataSymbol(integer(td_ExtCable),0,CablesToOutput,IndexCableOutput);
{td_InWireNo, what is the name of the WireNo (input)}
GetDataSymbol(integer(td_InWireNo),0,WireToInput,IndexWireInput);
{td_ExtWireNo, what is the name of the WireNo (ouput)}
GetDataSymbol(integer(td_ExtWireNo),0,WireToOutput,IndexWireOutput);
{td_JumperLink, shows if there a bridge on this terminal}
{if OutInt is not 0 then there is, and it's connected to all other}
{terminals that returns the same number as OutInt is}
GetDataInteger(integer(td_JumperLink),0,OutInt);
end;
end;
end;
