PCB API Functions reference

Note: The Altium Designer SDK is currently in the Beta phase and therefore evolving along with its documentation. This reference document, derived from the Altium Designer RTL documentation, is a work in progress and includes some aspects that are different to the new SDK.

The major PCB Functions are defined and implemented in the RT_PCBProcs unit.

Unit conversion functions

Function RealToMils (C : TReal) : TReal;
Function RealToMMs (C : TReal) : TReal;
Function CoordToMils (C : TCoord) : TReal;
Function CoordToMMs (C : TCoord) : TReal;
Function MilsToCoord (M : TReal) : TCoord;
Function MMsToCoord (M : TReal) : TCoord;
Function MilsToRealCoord(M : TReal) : TReal;
Function MMsToRealCoord (M : TReal) : TReal;

Function MetricString (Var S : TString; DefaultUnits : TUnit) : Boolean;
Function ImperialString(Var S : TString; DefaultUnits : TUnit) : Boolean;

Procedure StringToCoordUnit(S : TString; Var C : TCoord; Var U : TUnit);

Procedure StringToRealUnit (S : TString; Var R : TReal; Var U : TUnit);

Function CoordUnitToString(C : TCoord; U : TUnit) : TString;

Function RealUnitToString (R : TReal; U : TUnit) : TString;

Angle and Trigonometric functions

Function Degrees2Radians (Angle : TAngle) : TReal;
Function AngleToFormattedString(TextValue : TReal;
TextFormat : TString;
TextDimensionUnit : TDimensionUnit;
TextPrecision : Integer;
TextPrefix : TString;
TextSuffix : TString;
UseTTFonts : Boolean) : TString;

Function DistanceToFormattedString (TextValue : TReal;
TextFormat : TString;
TextDimensionUnit : TDimensionUnit;
TextPrecision : Integer;
TextPrefix : TString;
TextSuffix : TString;
DisplayUnit : TUnit;
DimensionKind : TDimensionKind;
UseTTFonts : Boolean) : TString;

Procedure NormalizeAngle (Var Angle : TAngle);

Procedure RotateCoordsAroundXY (Var x, y : TCoord;
Xr, Yr : TCoord;
Angle : TAngle);

Procedure FindZoomRect(Const FarRect, CloseRect : TCoordRect; Out ZoomRect : TCoordRect); Overload;
Procedure FindZoomRect(Const FarRect, CloseRect : TCoordRect; Out ZoomRect : TCoordRect; Const PrecisionFactor : Double); Overload;

Object Boundary Functions

Function GetFillBLX (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillBLY (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillTLX (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillTLY (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillTRX (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillTRY (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillBRX (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;
Function GetFillBRY (P : TPCBObjectHandle; ExpandBy : TCoord) : TCoord;

Layer conversion functions

Function Layer2String (Layer : TLayer) : TString;
Function String2Layer (Layer : TString): TLayer;

Font Functions

Procedure EnumFontsW (DC : HDC; Const AFontName : TPCBString; Items : TWideStrings);
Procedure EnumFontsA (DC : HDC; Const AFontName : TPCBString; Items : TStrings);
Function LoadFontNamesW (Items : TWideStrings) : Integer;
Function LoadFontNamesA (Items : TStrings) : Integer;
Function GetLocalizedFontName (Const FontName : TPCBString) : TPCBString;

Locale Functions

Function GetLocaleData(AID : LCID; AFlag : DWORD) : TDynamicString;
Function IsLocaleLanguageJapanese : Boolean;
Function IsLocaleLanguageEnglish : Boolean;
Function IsLocaleLanguageAsian : Boolean;

General Functions

GetIniFileName

Function GetIniFileName : AnsiString;

CoordsEqual

Function CoordsEqual (c1, c2 : Double) : Boolean;

ConvertEncodedText2WideString

Function ConvertEncodedText2WideString(Const EncodedText : TDynamicString) : TPCBString;

ConvertWideString2EncodedText

Function ConvertWideString2EncodedText(Const WString : TPCBString) : TDynamicString;

StringListCopy

Function StringListCopy (AWideStringList : TWideStringList; AAnsiStringList : TStringList) : Boolean;

StringToWideString

Function StringToWideString (const Str : string) : TPCBString;

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.