IPCB_Via interface
A via on a PCB document, a drilled and usually plated hole that carries a signal from one layer to another.
public interface IPCB_Via : IPCB_Primitive
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Inherits: IPCB_Primitive
Remarks
Vias are like round pads, which are drilled and usually through-plated when the board is fabricated. Vias can be multi-layered, blind or buried.
A multi-layer via passes through the board from the top layer to the bottom layer and allows connections to all other signal layers.
A blind via connects from the surface of the board to an internal layer, a buried via connects from one internal layer to another internal layer.
Example
Create a via with custom pad cache settings on a new PCB document.
using DXP;
using PCB;
// Create a new PCB document.
var workspace = DXP.GlobalVars.Client.GetDXPWorkspace() as EDP.IWorkspace;
if (workspace == null)
return;
workspace.DM_CreateNewDocument("PCB");
// Check whether the new PCB document exists.
IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
IPCB_Board board = pcbServer?.GetCurrentPCBBoard();
if (board == null)
return;
// Create a via object.
var via = pcbServer.PCBObjectFactory(TObjectId.eViaObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Via;
via.SetState_XLocation(EDP.Utils.MilsToCoord(2000));
via.SetState_YLocation(EDP.Utils.MilsToCoord(2000));
via.SetState_Size(EDP.Utils.MilsToCoord(50));
via.SetState_HoleSize(EDP.Utils.MilsToCoord(20));
via.SetState_LowLayer(new V7_Layer(TV6_Layer.eV6_TopLayer));
via.SetState_HighLayer(new V7_Layer(TV6_Layer.eV6_BottomLayer));
// Set up a pad cache.
V7_PadCache viaCache = via.GetState_Cache();
viaCache.ReliefAirGap = EDP.Utils.MilsToCoord(11);
viaCache.PowerPlaneReliefExpansion = EDP.Utils.MilsToCoord(11);
viaCache.PowerPlaneClearance = EDP.Utils.MilsToCoord(11);
viaCache.ReliefConductorWidth = EDP.Utils.MilsToCoord(11);
viaCache.SolderMaskExpansion = EDP.Utils.MilsToCoord(11);
viaCache.SolderMaskExpansionValid = TCacheState.eCacheManual;
viaCache.PasteMaskExpansion = EDP.Utils.MilsToCoord(11);
viaCache.PasteMaskExpansionValid = TCacheState.eCacheManual;
// Assign the new via cache to the via.
via.SetState_Cache(viaCache);
board.AddPCBObject(via);
// Refresh the PCB document.
string parameters = "";
DXP.Utils.SetParamterValue(ref parameters, "Action", "All");
DXP.Utils.RunCommand("PCB:Zoom", parameters);
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| Cache | V7_PadCache | get; set | The via's cache of values derived from design rules, such as solder mask expansion, power plane clearance, relief air gap and relief conductor width. |
| Height | int | get | The vertical length of the via, in internal units (10,000 per mil). |
| HighLayer | V7_LayerBase | get; set | One end layer of the via's span; together with LowLayer it defines the layers the via passes through. |
| HoleNegativeTolerance | int | get; set | The negative tolerance of the via's hole size, in internal units (10,000 per mil). |
| HolePositiveTolerance | int | get; set | The positive tolerance of the via's hole size, in internal units (10,000 per mil). |
| HoleSize | int | get; set | The diameter of the via's drilled hole, in internal units (10,000 per mil). |
| IsConnectedToPlane | bool | get; set | Whether the via is connected to the given internal plane layer. |
| LowLayer | V7_LayerBase | get; set | One end layer of the via's span; together with HighLayer it defines the layers the via passes through. |
| Mode | TPadMode | get; set | How the via's copper size is defined on its layers. |
| ShapeOnLayer | TShape | get | The shape of the via on the given layer; a via can have different shapes on the layers it connects. |
| Size | int | get; set | The diameter of the via, in internal units (10,000 per mil). |
| SizeOnLayer | int | get; set | The copper diameter of the via on the given layer, in internal units (10,000 per mil). |
| SolderMaskExpansionFromHoleEdge | bool | get; set | Whether the via's solder mask expansion is measured from the edge of the hole instead of the edge of the copper. |
| StackSizeOnLayer | int | get; set | The copper size stored for the via on the given layer, in internal units (10,000 per mil). |
| StartLayer | IPCB_LayerObject | get | The upper end layer of the via in the layer stack, the one of LowLayer and HighLayer that is higher. |
| StopLayer | IPCB_LayerObject | get | The lower end layer of the via in the layer stack, the one of LowLayer and HighLayer that is lower. |
| TemplateLink | IPCB_PadViaTemplateLink | get | |
| XLocation | int | get; set | The X coordinate of the via's center, in internal units (10,000 per mil). |
| YLocation | int | get; set | The Y coordinate of the via's center, in internal units (10,000 per mil). |
Cache
The via's cache of values derived from design rules, such as solder mask expansion, power plane clearance, relief air gap and relief conductor width.
V7_PadCache GetState_Cache();
void SetState_Cache(V7_PadCache argValue);
Type: V7_PadCache · Access: read/write
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
Assigning a cache does not change the via's tenting settings; they keep their previous values.
Height
The vertical length of the via, in internal units (10,000 per mil).
int GetState_Height();
Type: int · Access: read-only
For a via without a net it is the distance from the top of LowLayer to the bottom of HighLayer. For a via in a net it is the distance between the middles of the outermost layers on which tracks, arcs, pads or vias of the same net touch the via; it is 0 when nothing touches the via, and the distance between the middles of StartLayer and StopLayer when the via is touched on one layer only. Vias placed by via stitching or via shielding have a height of 0.
HighLayer
One end layer of the via's span; together with LowLayer it defines the layers the via passes through.
V7_LayerBase GetState_HighLayer();
void SetState_HighLayer(V7_LayerBase argL);
Type: V7_LayerBase · Access: read/write
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
For a through-hole via, LowLayer is the top layer and HighLayer is the bottom layer. The two ends can be given in either order: StartLayer and StopLayer return the upper and the lower of them in the layer stack. Only electrical layers are accepted; assigning any other layer leaves the value unchanged.
HoleNegativeTolerance
The negative tolerance of the via's hole size, in internal units (10,000 per mil).
int GetState_HoleNegativeTolerance();
void SetState_HoleNegativeTolerance(int argValue);
Type: int · Access: read/write
A negative value is stored as its absolute value.
HolePositiveTolerance
The positive tolerance of the via's hole size, in internal units (10,000 per mil).
int GetState_HolePositiveTolerance();
void SetState_HolePositiveTolerance(int argValue);
Type: int · Access: read/write
A negative value is stored as its absolute value.
HoleSize
The diameter of the via's drilled hole, in internal units (10,000 per mil).
int GetState_HoleSize();
void SetState_HoleSize(int argValue);
Type: int · Access: read/write
IsConnectedToPlane
Whether the via is connected to the given internal plane layer.
bool GetState_IsConnectedToPlane(TV6_Layer argLayer);
void SetState_IsConnectedToPlane(TV6_Layer argLayer, bool argValue);
Type: bool · Access: read/write · Index: argLayer (TV6_Layer)
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
Returns false for a layer that is not an internal plane layer, and while the via's plane connections have not been calculated (PlanesValid of Cache is TCacheState.eCacheInvalid). Assigning a value for a layer that is not an internal plane layer does nothing.
LowLayer
One end layer of the via's span; together with HighLayer it defines the layers the via passes through.
V7_LayerBase GetState_LowLayer();
void SetState_LowLayer(V7_LayerBase argL);
Type: V7_LayerBase · Access: read/write
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
For a through-hole via, LowLayer is the top layer and HighLayer is the bottom layer. The two ends can be given in either order: StartLayer and StopLayer return the upper and the lower of them in the layer stack. Only electrical layers are accepted; assigning any other layer leaves the value unchanged.
Mode
How the via's copper size is defined on its layers.
TPadMode GetState_Mode();
void SetState_Mode(TPadMode argMode);
Type: TPadMode · Access: read/write
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
Assigning Size sets the mode to TPadMode.ePadMode_Simple.
See also: TPadMode
ShapeOnLayer
The shape of the via on the given layer; a via can have different shapes on the layers it connects.
TShape GetState_ShapeOnLayer(V7_LayerBase argLayer);
Type: TShape · Access: read-only · Index: argLayer (V7_LayerBase)
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
See also: TShape
Size
The diameter of the via, in internal units (10,000 per mil).
int GetState_Size();
void SetState_Size(int argSize);
Type: int · Access: read/write
Reading returns the largest copper size on the signal layers from StartLayer to StopLayer. Assigning a value greater than 0 gives the via that size on all layers and sets Mode to TPadMode.ePadMode_Simple; a value of 0 or less is ignored.
SizeOnLayer
The copper diameter of the via on the given layer, in internal units (10,000 per mil).
int GetState_SizeOnLayer(V7_LayerBase argLayer);
void SetState_SizeOnLayer(V7_LayerBase argLayer, int argSize);
Type: int · Access: read/write · Index: argLayer (V7_LayerBase)
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
Assigning a value sets StackSizeOnLayer for that layer.
SolderMaskExpansionFromHoleEdge
Whether the via's solder mask expansion is measured from the edge of the hole instead of the edge of the copper.
bool GetState_SolderMaskExpansionFromHoleEdge();
void SetState_SolderMaskExpansionFromHoleEdge(bool argValue);
Type: bool · Access: read/write
The setting applies only to a via that reaches the top or bottom layer and whose solder mask expansion is set manually; when the expansion comes from the design rules, the applicable rule decides.
StackSizeOnLayer
The copper size stored for the via on the given layer, in internal units (10,000 per mil).
int GetState_StackSizeOnLayer(V7_LayerBase argLayer);
void SetState_StackSizeOnLayer(V7_LayerBase argLayer, int argSize);
Type: int · Access: read/write · Index: argLayer (V7_LayerBase)
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
Returns 0 for a layer that is not a signal layer. Assigning SizeOnLayer for a layer sets this value.
StartLayer
The upper end layer of the via in the layer stack, the one of LowLayer and HighLayer that is higher.
IPCB_LayerObject GetState_StartLayer();
Type: IPCB_LayerObject · Access: read-only
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
See also: IPCB_LayerObject
StopLayer
The lower end layer of the via in the layer stack, the one of LowLayer and HighLayer that is lower.
IPCB_LayerObject GetState_StopLayer();
Type: IPCB_LayerObject · Access: read-only
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
See also: IPCB_LayerObject
TemplateLink
No description yet.
IPCB_PadViaTemplateLink GetState_TemplateLink();
Type: IPCB_PadViaTemplateLink · Access: read-only
The accessors are extension methods of IPCB_ViaHelper (using PCB;).
XLocation
The X coordinate of the via's center, in internal units (10,000 per mil).
int GetState_XLocation();
void SetState_XLocation(int argX);
Type: int · Access: read/write
YLocation
The Y coordinate of the via's center, in internal units (10,000 per mil).
int GetState_YLocation();
void SetState_YLocation(int argY);
Type: int · Access: read/write
Methods
| Method | Returns | Description |
|---|---|---|
| ClearStackSizes | void | Removes all per-layer copper sizes stored for the via. |
| DefinitionLayerIterator | IPCB_LayerIterator | Returns an iterator over the layers for which the via has a copper size stored. |
| GetCounterHole_Params | IPCB_CounterHoleParams | |
| IntersectLayer | bool | Returns whether the via passes through the given layer. |
| IsCounterHole | bool | |
| PlaneConnectionStyleForLayer | TPlaneConnectionStyle | Returns how the via connects to the given internal plane layer. |
| RotateAroundXY | void | Rotates the via about a point. |
ClearStackSizes
Removes all per-layer copper sizes stored for the via.
void ClearStackSizes();
Returns: nothing (void)
DefinitionLayerIterator
Returns an iterator over the layers for which the via has a copper size stored.
IPCB_LayerIterator DefinitionLayerIterator();
Returns: IPCB_LayerIterator
Extension method of IPCB_ViaHelper (using PCB;).
GetCounterHole_Params
No description yet.
IPCB_CounterHoleParams GetCounterHole_Params();
Returns: IPCB_CounterHoleParams
Extension method of IPCB_ViaHelper (using PCB;).
IntersectLayer
Returns whether the via passes through the given layer.
bool IntersectLayer(V7_LayerBase argLayer);
bool IntersectLayer(IV7_Layer argLayer);
| Parameter | Type | Passing |
|---|---|---|
argLayer | V7_LayerBase | value |
Returns: bool
The first overload is an extension method of IPCB_ViaHelper (using PCB;) with typed parameters; the second is declared by the interface.
Returns true for an electrical layer within the via's span from LowLayer to HighLayer, and for the multi-layer and the keep-out layer; returns false for any other layer.
IsCounterHole
No description yet.
bool IsCounterHole();
Returns: bool
PlaneConnectionStyleForLayer
Returns how the via connects to the given internal plane layer.
TPlaneConnectionStyle PlaneConnectionStyleForLayer(TV6_Layer argLayer);
| Parameter | Type | Passing |
|---|---|---|
argLayer | TV6_Layer | value |
Returns: TPlaneConnectionStyle
Extension method of IPCB_ViaHelper (using PCB;).
The style of the connection comes from the applicable Power Plane Connect Style design rule: TPlaneConnectionStyle.ePlaneReliefConnect (a thermal relief connection) or TPlaneConnectionStyle.ePlaneDirectConnect (solid copper).
The method returns TPlaneConnectionStyle.ePlaneNoConnect when the layer is not an internal plane layer, when the via has no net, when the via does not pass through the layer, or when the via is not connected to the plane on that layer.
See also: TPlaneConnectionStyle
RotateAroundXY
Rotates the via about a point.
void RotateAroundXY(int argX, int argY, double argngle);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argX | int | value | The X coordinate of the point to rotate about, in internal units (10,000 per mil). |
argY | int | value | The Y coordinate of the point to rotate about, in internal units (10,000 per mil). |
argngle | double | value | The rotation angle, in degrees. |
Returns: nothing (void)
The via's center (XLocation, YLocation) is moved by the rotation. Passing the via's own center as the point leaves the via where it is.
Inherited members
- From IPCB_Primitive: AllowGlobalEdit, BeginModify, Board, BoundingRectangle, BoundingRectangleChildren, BoundingRectangleForPainting, BoundingRectangleForSelection, CancelModify, Component, Coordinate, DescriptorString, DetailString, Dimension, DrawAsPreview, DRCError, Enabled, Enabled_Direct, Enabled_vComponent, Enabled_vCoordinate, Enabled_vDimension, Enabled_vNet, Enabled_vPolygon, EnableDraw, EndModify, Export_ToParameters, FlipXY, GraphicallyInvalidate, Handle, Identifier, InBoard, InComponent, InCoordinate, Index, InDimension, InNet, InPolygon, InSelectionMemory, IsAssyTestPoint_Bottom, IsAssyTestPoint_Top, IsElectricalPrim, IsFreePrimitive, IsHidden, IsKeepout, IsPreRoute, IsSaveable, IsTenting, IsTenting_Bottom, IsTenting_Top, IsTestPoint_Bottom, IsTestPoint_Top, Layer, MiscFlag1, MiscFlag2, MiscFlag3, Moveable, MoveByXY, MoveToXY, Net, ObjectID, ObjectIDString, PadCacheRobotFlag, PasteMaskExpansion, Polygon, PolygonOutline, PowerPlaneClearance, PowerPlaneConnectStyle, PowerPlaneReliefExpansion, Preview, ReliefAirGap, ReliefConductorWidth, ReliefEntries, Replicate, RequiredParamterSpace, RotateBy, Selected, SolderMaskExpansion, SwapLayerPairs, TearDrop, UnionIndex, UniqueId, UniqueID, Used, UserRouted, V7Layer, ViewableObjectID
Accepted by
IPCB_ContourMaker.MakeContour_4, IPCB_ContourMaker2.MakeContour_14