Skip to main content
View as Markdown

IPCB_Net interface

A net on a PCB document, the group of pads, vias, tracks, arcs and connection lines that are electrically connected in the design.

public interface IPCB_Net : IPCB_Group

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive → IPCB_Group

Derived: IPCB_Net2

Remarks​

Net objects are system generated: the PCB editor creates them from the connectivity of the design. You can retrieve the net of any PCB object that has a net property.

A net is a list of pin to pin connections; their arrangement is called the net topology. By default the PCB editor arranges the pin to pin connections of each net to give the shortest overall connection length. To have control of the arrangement of the pin to pin connections in a net, the PCB editor allows the user to define a set of From-Tos.

Example​

List the names of all nets on the current board.

using PCB;

// Retrieve the current board.
IPCB_Board board = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (board == null)
return;

// Create an iterator that looks for net objects only.
IPCB_BoardIterator iterator = board.BoardIterator_Create();
iterator.AddFilter_ObjectSet(new PCB.TObjectSet { TObjectId.eNetObject });
iterator.AddFilter_AllLayers();
iterator.AddFilter_Method(TIterationMethod.eProcessAll);

// Collect the names of the nets.
string ls = "";
for (var net = iterator.FirstPCBObject() as IPCB_Net; net != null; net = iterator.NextPCBObject() as IPCB_Net)
ls = ls + net.GetState_Name() + ", ";
board.BoardIterator_Destroy(ref iterator);

// Display the net names.
DXP.Utils.ShowInfo("Nets = " + ls, "Nets");

Properties​

PropertyTypeAccessDescription
Coloruintget; setThe colour of the net.
ConnectivelyInvalidboolgetWhether the net's connectivity information (connection lines and lengths) is out of date.
ConnectsVisibleboolget; setWhether the net's connection lines are visible.
InDifferentialPairboolgetWhether the net belongs to a differential pair.
IsHighlightedboolget; setWhether the net is highlighted.
JumpersVisibleboolget; setWhether the jumper links of the net are visible.
LiveHighlightModeTLiveHighlightModeget; setThe live highlight mode of the net.
LoopRemovalboolget; setWhether loop removal is enabled for the net.
Namestringget; setThe name of the net.
OverrideColorForDrawboolget; setWhether the net's primitives are drawn in the net's Color.
PinCountintgetThe number of pads in the net.
RoutedLengthintgetThe routed length of the net, in internal units (10,000 per mil).
ViaCountintgetThe number of vias in the net.

Color​

The colour of the net.

uint GetState_Color();
void SetState_Color(uint argColor);

Type: uint · Access: read/write

A new net has the colour of the connection layer. The colour is used to draw the net's primitives only while OverrideColorForDraw is true.

ConnectivelyInvalid​

Whether the net's connectivity information (connection lines and lengths) is out of date.

bool GetState_ConnectivelyInvalid();

Type: bool · Access: read-only

Becomes true when a primitive is added to or removed from the net, and when ConnectivelyInValidate is called; RoutedLength is then recalculated on its next read. Rebuild clears it.

ConnectsVisible​

Whether the net's connection lines are visible.

bool GetState_ConnectsVisible();
void SetState_ConnectsVisible(bool argValue);

Type: bool · Access: read/write

A new net has its connection lines visible. Assigning a value only changes the setting and does not update the display; HideNetConnects and ShowNetConnects change the setting and update the display. While the value is false, Rebuild does nothing.

InDifferentialPair​

Whether the net belongs to a differential pair.

bool GetState_InDifferentialPair();

Type: bool · Access: read-only

IsHighlighted​

Whether the net is highlighted.

bool GetState_IsHighlighted();
void SetState_IsHighlighted(bool argDummy);

Type: bool · Access: read/write

Assigning any value, including false, sets the net's highlight flag; assigning false does not clear the highlight.

JumpersVisible​

Whether the jumper links of the net are visible.

bool GetState_JumpersVisible();
void SetState_JumpersVisible(bool argValue);

Type: bool · Access: read/write

A new net has its jumper links visible. Assigning a value only changes the setting and does not redraw the components with jumper pads on the net.

LiveHighlightMode​

The live highlight mode of the net.

TLiveHighlightMode GetState_LiveHighlightMode();
void SetState_LiveHighlightMode(TLiveHighlightMode argValue);

Type: TLiveHighlightMode · Access: read/write

The accessors are extension methods of IPCB_NetHelper (using PCB;).

A new net has TLiveHighlightMode.eLiveHighlightMode_None. Assigning TLiveHighlightMode.eLiveHighlightMode_High adds the net to the board's highlighted objects; assigning any other value removes it from them.

LoopRemoval​

Whether loop removal is enabled for the net.

bool GetState_LoopRemoval();
void SetState_LoopRemoval(bool argValue);

Type: bool · Access: read/write

A new net has loop removal enabled.

Name​

The name of the net.

string GetState_Name();
void SetState_Name(string argName);

Type: string · Access: read/write

The name is also the net's Identifier; DescriptorString returns Net followed by a space and the name.

OverrideColorForDraw​

Whether the net's primitives are drawn in the net's Color.

bool GetState_OverrideColorForDraw();
void SetState_OverrideColorForDraw(bool argValue);

Type: bool · Access: read/write

A new net has the value false.

PinCount​

The number of pads in the net.

int GetState_PinCount();

Type: int · Access: read-only

RoutedLength​

The routed length of the net, in internal units (10,000 per mil).

int GetState_RoutedLength();

Type: int · Access: read-only

The sum of the lengths of the net's tracks and arcs on signal layers and the heights (IPCB_Via.Height) of its vias. The value is 0 for a net to which a Supply Nets design rule applies.

ViaCount​

The number of vias in the net.

int GetState_ViaCount();

Type: int · Access: read-only

Methods​

MethodReturnsDescription
CancelGroupWarehouseRegistrationvoidRemoves a primitive from the net.
ConnectivelyInValidatevoidMarks the net's connectivity information as out of date.
GetLogicalNetIPCB_GroupReturns the net itself.
Getstate_PadByNameIPCB_Primitive
Getstate_PadByPinDescriptionIPCB_Primitive
GetSubnetsIPCB_GroupReturns a group with the net's subnets, the parts of the net that are electrically connected to each other.
HideNetConnectsvoidHides the net's connection lines.
RebuildvoidRecalculates the net's connection lines.
RegisterWithGroupWarehousevoidAdds a primitive to the net.
ShowNetConnectsvoidShows the net's connection lines.
SubnetIndices_ResetvoidRecalculates the subnet index of every primitive of the net.
SubnetIndices_SetvoidRecalculates the subnet index of every primitive of the net.

CancelGroupWarehouseRegistration​

Removes a primitive from the net.

void CancelGroupWarehouseRegistration(IPCB_Pad argiPad);
void CancelGroupWarehouseRegistration(object argiPad);
ParameterTypePassingDescription
argiPadIPCB_PadvalueThe primitive to remove. Any primitive of the net can be passed, not only a pad.

Returns: nothing (void)

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

Does nothing when the primitive does not belong to this net. Otherwise the primitive's InNet becomes false and the net's ConnectivelyInvalid becomes true.

To move a primitive to another net, call CancelGroupWarehouseRegistration on its current net, assign the primitive's Net, then call RegisterWithGroupWarehouse on the new net, between the primitive's BeginModify and EndModify.

ConnectivelyInValidate​

Marks the net's connectivity information as out of date.

void ConnectivelyInValidate();

Returns: nothing (void)

Sets ConnectivelyInvalid to true; Rebuild recalculates the connection lines and clears it again.

GetLogicalNet​

Returns the net itself.

IPCB_Group GetLogicalNet();

Returns: IPCB_Group

Extension method of IPCB_NetHelper (using PCB;).

Getstate_PadByName​

No description yet.

IPCB_Primitive Getstate_PadByName(string argPadName);
ParameterTypePassing
argPadNamestringvalue

Returns: IPCB_Primitive

Extension method of IPCB_NetHelper (using PCB;).

Getstate_PadByPinDescription​

No description yet.

IPCB_Primitive Getstate_PadByPinDescription(string argPinDes);
ParameterTypePassing
argPinDesstringvalue

Returns: IPCB_Primitive

Extension method of IPCB_NetHelper (using PCB;).

GetSubnets​

Returns a group with the net's subnets, the parts of the net that are electrically connected to each other.

IPCB_Group GetSubnets();

Returns: IPCB_Group

Extension method of IPCB_NetHelper (using PCB;).

The group is calculated on the first call and kept by the net. It belongs to the net and is discarded when a primitive of the net other than a connection line is added, removed or modified; call the method again afterwards instead of keeping the result.

HideNetConnects​

Hides the net's connection lines.

void HideNetConnects();

Returns: nothing (void)

Removes the connection lines from the display and sets ConnectsVisible to false. Does nothing when the connection lines are already hidden.

Rebuild​

Recalculates the net's connection lines.

void Rebuild();

Returns: nothing (void)

Clears ConnectivelyInvalid. Does nothing while ConnectsVisible is false.

RegisterWithGroupWarehouse​

Adds a primitive to the net.

void RegisterWithGroupWarehouse(IPCB_Pad argiPad);
void RegisterWithGroupWarehouse(object argiPad);
ParameterTypePassingDescription
argiPadIPCB_PadvalueThe primitive to add. Any primitive can be passed, not only a pad.

Returns: nothing (void)

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

The primitive's Net becomes this net, its InNet becomes true and the net's ConnectivelyInvalid becomes true. Nothing is added for a text object, or for a primitive that is not on a signal layer, the multi-layer or the connection layer; the primitive's Net is cleared instead. Nothing is added either while the primitive's InNet is true, that is, while it still belongs to a net.

To move a primitive to another net, call CancelGroupWarehouseRegistration on its current net, assign the primitive's Net, then call RegisterWithGroupWarehouse on the new net, between the primitive's BeginModify and EndModify.

ShowNetConnects​

Shows the net's connection lines.

void ShowNetConnects();

Returns: nothing (void)

Sets ConnectsVisible to true and adds the connection lines to the display. Does nothing when the connection lines are already visible.

SubnetIndices_Reset​

Recalculates the subnet index of every primitive of the net.

void SubnetIndices_Reset();

Returns: nothing (void)

Does the same as SubnetIndices_Set; it does not leave the indices cleared.

SubnetIndices_Set​

Recalculates the subnet index of every primitive of the net.

void SubnetIndices_Set();

Returns: nothing (void)

Clears the indices first, then gives each primitive the index of the subnet (the electrically connected part of the net) that it belongs to.

Inherited members​

Returned by​

IPCB_CopperBody.Net, IPCB_DifferentialPair.NegativeNet, IPCB_DifferentialPair.PositiveNet, IPCB_FromTo.GetNet, IPCB_Primitive.Net

Accepted by​

IPCB_Board.AnalyzeNet, IPCB_Board.CleanNet, IPCB_Board.NetNameIsUnique, IPCB_ConnectivityGraph.RebuildNet, IPCB_PinPairsManager.SwapPins, IPCB_SMDToPlaneConstraint.IsInternalPlaneNet