Skip to main content
View as Markdown

IPCB_Track interface

A straight track segment on a PCB document, from (X1, Y1) to (X2, Y2), with a stroke Width.

public interface IPCB_Track : IPCB_Primitive

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive

Derived: IPCB_Wirebond

Remarks​

Tracks can be placed on signal, plane, overlay, mask, keep-out and mechanical layers. Tracks are also used in polygons, coordinates, dimensions and components.

The coordinates and the width are in internal units (10,000 per mil); see IPCB_Primitive.

Example​

Create a track on a new PCB document.

using DXP;
using PCB;

// Sample values: track coordinates and width in mils, and the track layer.
double x1 = 1000, y1 = 1000, x2 = 3000, y2 = 1000, width = 10;
TV6_Layer layer = TV6_Layer.eV6_TopLayer;

// 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 track object with dimensions in mils.
var track = pcbServer.PCBObjectFactory(TObjectId.eTrackObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Track;
track.SetState_X1(EDP.Utils.MilsToCoord(x1));
track.SetState_Y1(EDP.Utils.MilsToCoord(y1));
track.SetState_X2(EDP.Utils.MilsToCoord(x2));
track.SetState_Y2(EDP.Utils.MilsToCoord(y2));
track.SetState_Layer(layer);
track.SetState_Width(EDP.Utils.MilsToCoord(width));

// Add the new track to the PCB document.
board.AddPCBObject(track);

// Refresh the PCB document.
string parameters = "";
DXP.Utils.SetParamterValue(ref parameters, "Action", "All");
DXP.Utils.RunCommand("PCB:Zoom", parameters);

Properties​

PropertyTypeAccessDescription
Widthintget; setThe stroke width of the track, in internal units (10,000 per mil).
X1intget; setThe X coordinate of the track's first end point, in internal units (10,000 per mil).
X2intget; setThe X coordinate of the track's second end point, in internal units (10,000 per mil).
Y1intget; setThe Y coordinate of the track's first end point, in internal units (10,000 per mil).
Y2intget; setThe Y coordinate of the track's second end point, in internal units (10,000 per mil).

Width​

The stroke width of the track, in internal units (10,000 per mil).

int GetState_Width();
void SetState_Width(int argValue);

Type: int · Access: read/write

X1​

The X coordinate of the track's first end point, in internal units (10,000 per mil).

int GetState_X1();
void SetState_X1(int argValue);

Type: int · Access: read/write

X2​

The X coordinate of the track's second end point, in internal units (10,000 per mil).

int GetState_X2();
void SetState_X2(int argValue);

Type: int · Access: read/write

Y1​

The Y coordinate of the track's first end point, in internal units (10,000 per mil).

int GetState_Y1();
void SetState_Y1(int argValue);

Type: int · Access: read/write

Y2​

The Y coordinate of the track's second end point, in internal units (10,000 per mil).

int GetState_Y2();
void SetState_Y2(int argValue);

Type: int · Access: read/write

Inherited members​

Returned by​

IPCB_AngularDimension.Arrow1_Track1, IPCB_AngularDimension.Arrow1_Track2, IPCB_AngularDimension.Arrow2_Track1, IPCB_AngularDimension.Arrow2_Track2, IPCB_AngularDimension.Extension1_Track, IPCB_AngularDimension.Extension2_Track, IPCB_BaselineDimension.Arrow1_Track1, IPCB_BaselineDimension.Arrow1_Track2, IPCB_BaselineDimension.Arrow2_Track1, IPCB_BaselineDimension.Arrow2_Track2, IPCB_BaselineDimension.Extension1_Track, IPCB_BaselineDimension.Extension2_Track, IPCB_BaselineDimension.Line_Track1, IPCB_BaselineDimension.Line_Track2, IPCB_CenterDimension.Cross_Horizontal_Track, IPCB_CenterDimension.Cross_Vertical_Track, IPCB_DatumDimension.Extension_Track, IPCB_LeaderDimension.Arrow_Track1, IPCB_LeaderDimension.Arrow_Track2, IPCB_LeaderDimension.Line_Track, IPCB_LeaderDimension.Square_Track1, IPCB_LeaderDimension.Square_Track2, IPCB_LeaderDimension.Square_Track3, IPCB_LeaderDimension.Square_Track4, IPCB_LinearDimension.Arrow1_Track1, IPCB_LinearDimension.Arrow1_Track2, IPCB_LinearDimension.Arrow2_Track1, IPCB_LinearDimension.Arrow2_Track2, IPCB_LinearDimension.Extension1_Track, IPCB_LinearDimension.Extension2_Track, IPCB_LinearDimension.Line_Track1, IPCB_LinearDimension.Line_Track2, IPCB_RadialDiameterDimension.Arrow2_Track1, IPCB_RadialDiameterDimension.Arrow2_Track2, IPCB_RadialDiameterDimension.Line3_Track, IPCB_RadialDimension.Arrow_Track1, IPCB_RadialDimension.Arrow_Track2, IPCB_RadialDimension.Line1_Track, IPCB_RadialDimension.Line2_Track

Accepted by​

IPCB_ContourMaker.MakeContour_1, IPCB_ContourMaker2.MakeContour_11