Skip to main content
View as Markdown

IPCB_Coordinate interface

A coordinate marker on a PCB document: a cross of two tracks at a point and a text that shows the X and Y coordinates of that point.

public interface IPCB_Coordinate : IPCB_Group

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive → IPCB_Group

Remarks​

A coordinate is a group with three child primitives: the text (Text), the horizontal track (Track1) and the vertical track (Track2). The marked point is the group's XLocation and YLocation; the children are placed on the coordinate's Layer. The text is placed at the right end of the horizontal track and shows the location relative to the board origin, in the board's DisplayUnit, formatted as set by Style. It is empty when the coordinate does not belong to a board.

SetState_XSizeYSize_1 regenerates the children from the coordinate's properties only when the location or the layer has changed since the last regeneration, or when its TrueType text must be rebuilt. Changing only a size, style or font property therefore does not regenerate the marker. MoveByXY moves the coordinate and regenerates the children.

Properties​

PropertyTypeAccessDescription
Boldboolget; setWhether the text of the coordinate is bold when it uses a TrueType font.
FontNamestringget; setThe name of the TrueType font of the coordinate's text, for example Arial or Courier New.
Italicboolget; setWhether the text of the coordinate is italic when it uses a TrueType font.
LineWidthintget; setThe width of the two tracks of the coordinate's cross, in internal units (10,000 per mil).
Rotationdoubleget; setThe rotation of the coordinate's text, in degrees.
Sizeintget; setHalf the length of each track of the coordinate's cross, in internal units (10,000 per mil).
StrictHitTestboolgetWhether the given point hits the text or one of the tracks of the coordinate.
StyleTUnitStyleget; setHow the text of the coordinate shows the units of the X and Y values.
TextFontshortget; setThe stroke font of the coordinate's text.
TextHeightintget; setThe height of the coordinate's text, in internal units (10,000 per mil).
TextWidthintget; setThe stroke width of the coordinate's text, in internal units (10,000 per mil).
UseTTFontsboolget; setWhether the text of the coordinate uses a TrueType font (FontName, Bold, Italic) rather than the stroke font TextFont.

Bold​

Whether the text of the coordinate is bold when it uses a TrueType font.

bool GetState_Bold();
void SetState_Bold(bool argBold);

Type: bool · Access: read/write

A new coordinate is not bold.

FontName​

The name of the TrueType font of the coordinate's text, for example Arial or Courier New.

string GetState_FontName();
void SetState_FontName(string argFontName);

Type: string · Access: read/write

The value is used when UseTTFonts is true. A new coordinate uses Arial.

Italic​

Whether the text of the coordinate is italic when it uses a TrueType font.

bool GetState_Italic();
void SetState_Italic(bool argItalic);

Type: bool · Access: read/write

A new coordinate is not italic.

LineWidth​

The width of the two tracks of the coordinate's cross, in internal units (10,000 per mil).

int GetState_LineWidth();
void SetState_LineWidth(int argValue);

Type: int · Access: read/write

A new coordinate has a line width of 10 mil.

Rotation​

The rotation of the coordinate's text, in degrees.

double GetState_Rotation();
void SetState_Rotation(double argValue);

Type: double · Access: read/write

Only the text is rotated; the tracks of the cross stay horizontal and vertical. A new coordinate has a rotation of 0.

Size​

Half the length of each track of the coordinate's cross, in internal units (10,000 per mil).

int GetState_Size();
void SetState_Size(int argValue);

Type: int · Access: read/write

Each track extends by Size on both sides of the marked point, and the text starts Size to the right of it. When the value is less than 10 (0.001 mil), the tracks extend by 1 mil instead. A new coordinate has a size of 10 mil.

StrictHitTest​

Whether the given point hits the text or one of the tracks of the coordinate.

bool GetState_StrictHitTest(int argHitX, int argHitY);

Type: bool · Access: read-only · Index: argHitX (int): The X coordinate of the point, in internal units (10,000 per mil)., argHitY (int): The Y coordinate of the point, in internal units (10,000 per mil).

Style​

How the text of the coordinate shows the units of the X and Y values.

TUnitStyle GetState_Style();
void SetState_Style(TUnitStyle argValue);

Type: TUnitStyle · Access: read/write

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

With TUnitStyle.eNoUnits the text shows the two values separated by a comma, without units. With TUnitStyle.eYesUnits each value has its unit. With TUnitStyle.eParenthUnits the values are followed by "(mm)" when the board's DisplayUnit is TUnit.eMetric, otherwise by "(mil)". A new coordinate uses TUnitStyle.eParenthUnits.

See also: TUnitStyle

TextFont​

The stroke font of the coordinate's text.

short GetState_TextFont();
void SetState_TextFont(short argValue);

Type: short · Access: read/write

A new coordinate uses font 1.

TextHeight​

The height of the coordinate's text, in internal units (10,000 per mil).

int GetState_TextHeight();
void SetState_TextHeight(int argValue);

Type: int · Access: read/write

A new coordinate has a text height of 60 mil.

TextWidth​

The stroke width of the coordinate's text, in internal units (10,000 per mil).

int GetState_TextWidth();
void SetState_TextWidth(int argValue);

Type: int · Access: read/write

A new coordinate has a text width of 6 mil.

UseTTFonts​

Whether the text of the coordinate uses a TrueType font (FontName, Bold, Italic) rather than the stroke font TextFont.

bool GetState_UseTTFonts();
void SetState_UseTTFonts(bool argUseTTFonts);

Type: bool · Access: read/write

A new coordinate uses the stroke font.

Methods​

MethodReturnsDescription
RotateAroundXYvoidDoes nothing for a coordinate.
SetState_XSizeYSize_1boolRegenerates the text and the tracks of the coordinate from its properties and recalculates its bounds.
TextIPCB_PrimitiveReturns the text primitive of the coordinate, which shows the X and Y values.
Track1IPCB_PrimitiveReturns the horizontal track of the coordinate's cross.
Track2IPCB_PrimitiveReturns the vertical track of the coordinate's cross.

RotateAroundXY​

Does nothing for a coordinate.

void RotateAroundXY(int argX, int argY, double argngle);
ParameterTypePassing
argXintvalue
argYintvalue
argngledoublevalue

Returns: nothing (void)

SetState_XSizeYSize_1​

Regenerates the text and the tracks of the coordinate from its properties and recalculates its bounds.

bool SetState_XSizeYSize_1();

Returns: bool

The children are regenerated only when the location or the layer has changed since the last regeneration, or when the TrueType text must be rebuilt.

Text​

Returns the text primitive of the coordinate, which shows the X and Y values.

IPCB_Primitive Text();

Returns: IPCB_Primitive

Extension method of IPCB_CoordinateHelper (using PCB;).

Its value, position and font are overwritten when the children are regenerated.

Track1​

Returns the horizontal track of the coordinate's cross.

IPCB_Primitive Track1();

Returns: IPCB_Primitive

Extension method of IPCB_CoordinateHelper (using PCB;).

Track2​

Returns the vertical track of the coordinate's cross.

IPCB_Primitive Track2();

Returns: IPCB_Primitive

Extension method of IPCB_CoordinateHelper (using PCB;).

Inherited members​

Returned by​

IPCB_Primitive.Coordinate