Skip to main content
View as Markdown

IPCB_Text3 interface

An extension of IPCB_Text that positions a text by its snap point and copies text properties.

public interface IPCB_Text3 : IPCB_Text

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive → IPCB_RectangularPrimitive → IPCB_Text

Remarks​

Every text object supports this interface: cast an IPCB_Text, such as a component's IPCB_Component.Name or IPCB_Component.Comment, to IPCB_Text3 to use these members.

Properties​

PropertyTypeAccessDescription
AdvanceSnappingboolget; setWhether the text is positioned by its snap point (SnapPointX, SnapPointY) rather than by its reference point (XLocation, YLocation).
SnapPointXintget; setThe X coordinate of the text's snap point, in internal units (10,000 per mil).
SnapPointYintget; setThe Y coordinate of the text's snap point, in internal units (10,000 per mil).

AdvanceSnapping​

Whether the text is positioned by its snap point (SnapPointX, SnapPointY) rather than by its reference point (XLocation, YLocation).

bool GetState_AdvanceSnapping();
void SetState_AdvanceSnapping(bool argValue);

Type: bool · Access: read/write

A text created with IPCB_ServerInterface.PCBObjectFactory has the value false. When the value is true, PushJustificationCenter saves the snap point even when argPushState is false.

SnapPointX​

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

int GetState_SnapPointX();
void SetState_SnapPointX(int argValue);

Type: int · Access: read/write

When AdvanceSnapping is true, the snap point is calculated from the corner of the text rectangle, and assigning a value moves the whole text so that its snap point is at the new coordinate. When AdvanceSnapping is false, the value is XLocation and assigning it sets XLocation.

SnapPointY​

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

int GetState_SnapPointY();
void SetState_SnapPointY(int argValue);

Type: int · Access: read/write

When AdvanceSnapping is true, the snap point is calculated from the corner of the text rectangle, and assigning a value moves the whole text so that its snap point is at the new coordinate. When AdvanceSnapping is false, the value is YLocation and assigning it sets YLocation.

Methods​

MethodReturnsDescription
CopyTovoidCopies the properties of the text to another text object.
GetActualTextBrCoordRectReturns the rectangle occupied by the string of the text, in internal units (10,000 per mil).
PushJustificationCentervoidSaves the current snap point of the text so that RepositionAfterPush can move the text back to it.
RepositionAfterPushvoidMoves the text so that its snap point is at the point saved by PushJustificationCenter.
StringXPositionintReturns the X coordinate at which the string of the text starts, in internal units (10,000 per mil).
StringYPositionintReturns the Y coordinate at which the string of the text starts, in internal units (10,000 per mil).
UpdateTextPositionvoidRecalculates the size and position of the text, as SetState_XSizeYSize does.

CopyTo​

Copies the properties of the text to another text object.

void CopyTo(IPCB_Text argP, TCopyMode argCopyMode);
void CopyTo(object argP, int argCopyMode);
ParameterTypePassingDescription
argPIPCB_TextvalueThe text object that receives the properties.
argCopyModeTCopyModevalue

Returns: nothing (void)

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

The copied properties include the location, Size, FontID, Rotation, Mirror, Width, the TrueType font settings, the inverted-text and barcode settings, TextKind, AdvanceSnapping and the underlying string.

GetActualTextBr​

Returns the rectangle occupied by the string of the text, in internal units (10,000 per mil).

CoordRect GetActualTextBr();

Returns: CoordRect

Extension method of IPCB_Text3Helper (using PCB;).

The rectangle is TTFTextWidth wide and TTFTextHeight high and takes Rotation into account. For a barcode it starts at the reference point, offset by BarCodeXMargin and BarCodeYMargin when BarCodeInverted is true; for other text it is placed inside the rectangle of inverted text (InvRectWidth by InvRectHeight) as TTFInvertedTextJustify specifies.

PushJustificationCenter​

Saves the current snap point of the text so that RepositionAfterPush can move the text back to it.

void PushJustificationCenter(bool argPushState);
ParameterTypePassingDescription
argPushStateboolvalueTrue to save the snap point even when AdvanceSnapping is false.

Returns: nothing (void)

Nothing is saved for the text of a dimension or a coordinate, or when a point is already saved. Recalculating the size of a text on a board (SetState_XSizeYSize) discards the saved point.

RepositionAfterPush​

Moves the text so that its snap point is at the point saved by PushJustificationCenter.

void RepositionAfterPush();

Returns: nothing (void)

Does nothing when no point is saved or for the text of a dimension or a coordinate.

StringXPosition​

Returns the X coordinate at which the string of the text starts, in internal units (10,000 per mil).

int StringXPosition();

Returns: int

For a barcode whose BarCodeInverted is true, the value is XLocation plus BarCodeXMargin.

StringYPosition​

Returns the Y coordinate at which the string of the text starts, in internal units (10,000 per mil).

int StringYPosition();

Returns: int

For a barcode whose BarCodeInverted is true, the value is YLocation plus BarCodeYMargin.

UpdateTextPosition​

Recalculates the size and position of the text, as SetState_XSizeYSize does.

void UpdateTextPosition();

Returns: nothing (void)

Inherited members​