Skip to main content
View as Markdown

IConnectionsArray interface

The IConnectionsArray represents the bus and wire connections in a schematic document. Bus and wire connections that have more than 3 connections could be connected by an automatic junction or a manual junction (placed by an user).

public interface IConnectionsArray

Namespace: SCH · Assembly: Altium.SDK.Interfaces

Remarks​

A schematic with valid buses and wires will have connections. An IConnectionsArray interface has all the connections for this schematic sheet and each element in the IConnectionsArray interface is a IConnection interface type.

Example​

Iterate over the bus connections of the current schematic sheet.

using SCH;

var currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument() as ISch_Sheet;
if (currentSheet == null)
return;
IConnectionsArray theBusConnections = currentSheet.GetState_BusConnections();

for (int j = 0; j < theBusConnections.GetState_ConnectionsCount(); j++)
{
IConnection busConnection = theBusConnections.GetState_Connection(j);
if (busConnection != null)
{
// Process the bus connection here.
}
}

Properties​

PropertyTypeAccessDescription
ConnectionIConnectiongetThis method retrieves the indexed connection of IConnection type from the IConnectionsArray interface.
ConnectionsCountintgetThis method returns the number of connections for wires or buses on the schematic sheet.

Connection​

This method retrieves the indexed connection of IConnection type from the IConnectionsArray interface.

IConnection GetState_Connection(int argIndex);

Type: IConnection · Access: read-only · Index: argIndex (int)

The accessors are extension methods of IConnectionsArrayHelper (using SCH;).

ConnectionsCount​

This method returns the number of connections for wires or buses on the schematic sheet. For each

int GetState_ConnectionsCount();

Type: int · Access: read-only

Methods​

MethodReturnsDescription
AddConnectionvoidThis method adds a connection with a location parameter into the IConnectionsArray object.
AddConnectionXYvoidThis method adds a connection with X,Y parameters into the IConnectionsArray object.
AddConnectionXY_WithSizevoid
GetConnectionAtIConnectionThis method retrieves the connection of IConnection type based on a location.
GraphicallyInvalidatevoidThis method puts the group of design objects (bus or wire objects in an connection array) in an invalid state.
RemoveAllConnectionsAtboolThis method removes all connections at this specified location on the schematic document.
RemoveAllConnectionsForLineboolThis method removes all connections for the specified line with L1 and L2 parameters.
ResetAllConnectionsvoidThis method resets all connections (frees all items) in the IConnectionsArray interface for either wire or bus connections.

AddConnection​

This method adds a connection with a location parameter into the IConnectionsArray object.

void AddConnection(Point argLocation);
void AddConnection(IPoint argLocation);
ParameterTypePassing
argLocationPointvalue

Returns: nothing (void)

The first overload is an extension method of IConnectionsArrayHelper (using SCH;) with typed parameters; the second is declared by the interface.

See also: IConnectionsArray.AddConnectionXY

AddConnectionXY​

This method adds a connection with X,Y parameters into the IConnectionsArray object.

void AddConnectionXY(int argx, int argy);
ParameterTypePassing
argxintvalue
argyintvalue

Returns: nothing (void)

See also: IConnectionsArray.AddConnection

AddConnectionXY_WithSize​

No description yet.

void AddConnectionXY_WithSize(int argx, int argy, TSize argSize);
void AddConnectionXY_WithSize(int argx, int argy, int argSize);
ParameterTypePassing
argxintvalue
argyintvalue
argSizeTSizevalue

Returns: nothing (void)

The first overload is an extension method of IConnectionsArrayHelper (using SCH;) with typed parameters; the second is declared by the interface.

GetConnectionAt​

This method retrieves the connection of IConnection type based on a location.

IConnection GetConnectionAt(Point argLocation);
ParameterTypePassingDescription
argLocationPointvalueThe location the connection is retrieved for.

Returns: IConnection

Extension method of IConnectionsArrayHelper (using SCH;).

Example: Show how many objects meet at a wire connection of the current schematic sheet.

using SCH;

var currentSheet = SCH.GlobalVars.SchServer?.GetCurrentSchDocument() as ISch_Sheet;
if (currentSheet == null)
return;
IConnectionsArray connections = currentSheet.GetState_WireConnections();
// Sample values: the location to look at.
var location = new DXP.Point(new DXP.SPoint { X = EDP.Utils.MilsToCoord(1000), Y = EDP.Utils.MilsToCoord(1000) });

IConnection connection = connections.GetConnectionAt(location);
if (connection != null)
DXP.Utils.ShowMessage(connection.GetState_ObjectsCount().ToString());

GraphicallyInvalidate​

This method puts the group of design objects (bus or wire objects in an connection array) in an invalid state. A redraw is required to update the schematic sheet.

void GraphicallyInvalidate();

Returns: nothing (void)

RemoveAllConnectionsAt​

This method removes all connections at this specified location on the schematic document.

bool RemoveAllConnectionsAt(Point argLocation);
bool RemoveAllConnectionsAt(IPoint argLocation);
ParameterTypePassing
argLocationPointvalue

Returns: bool

The first overload is an extension method of IConnectionsArrayHelper (using SCH;) with typed parameters; the second is declared by the interface.

RemoveAllConnectionsForLine​

This method removes all connections for the specified line with L1 and L2 parameters. If the call was successful, a true value is returned. The Connections can either represent bus or wire connections.

bool RemoveAllConnectionsForLine(Point argL1, Point argL2);
bool RemoveAllConnectionsForLine(IPoint argL1, IPoint argL2);
ParameterTypePassing
argL1Pointvalue
argL2Pointvalue

Returns: bool

The first overload is an extension method of IConnectionsArrayHelper (using SCH;) with typed parameters; the second is declared by the interface.

ResetAllConnections​

This method resets all connections (frees all items) in the IConnectionsArray interface for either wire or bus connections.

void ResetAllConnections();

Returns: nothing (void)

Returned by​

ISch_Sheet.BusConnections, ISch_Sheet.WireConnections