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
| Property | Type | Access | Description |
|---|---|---|---|
| AdvanceSnapping | bool | get; set | Whether the text is positioned by its snap point (SnapPointX, SnapPointY) rather than by its reference point (XLocation, YLocation). |
| SnapPointX | int | get; set | The X coordinate of the text's snap point, in internal units (10,000 per mil). |
| SnapPointY | int | get; set | The 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
| Method | Returns | Description |
|---|---|---|
| CopyTo | void | Copies the properties of the text to another text object. |
| GetActualTextBr | CoordRect | Returns the rectangle occupied by the string of the text, in internal units (10,000 per mil). |
| PushJustificationCenter | void | Saves the current snap point of the text so that RepositionAfterPush can move the text back to it. |
| RepositionAfterPush | void | Moves the text so that its snap point is at the point saved by PushJustificationCenter. |
| StringXPosition | int | Returns the X coordinate at which the string of the text starts, in internal units (10,000 per mil). |
| StringYPosition | int | Returns the Y coordinate at which the string of the text starts, in internal units (10,000 per mil). |
| UpdateTextPosition | void | Recalculates 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argP | IPCB_Text | value | The text object that receives the properties. |
argCopyMode | TCopyMode | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argPushState | bool | value | True 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
- From IPCB_Text: BarCodeBitPattern, BarCodeFontName, BarCodeFullHeight, BarCodeFullWidth, BarCodeInverted, BarCodeKind, BarCodeMinWidth, BarCodeRenderMode, BarCodeShowText, BarCodeXMargin, BarCodeYMargin, Bold, BorderSpaceType, CanEditMultilineRectSize, CharSet, ConvertedString, ConvertToStrokeArray, FontID, FontName, GetDesignatorDisplayString, GetTrueTypeTextOutlineGeometricPolygon, GetTrueTypeTextOutlineGeometricPolygon_1, InAutoDimension, Inverted, InvertedTTTextBorder, InvRectHeight, InvRectWidth, IsComment, IsDesignator, IsHidden_1, Italic, Mirror, Multiline, MultilineTextAutoPosition, MultilineTextHeight, MultilineTextResizeEnabled, MultilineTextWidth, RotationHandle, Size, Text, TextKind, TTFInvertedTextJustify, TTFOffsetFromInvertedRect, TTFTextHeight, TTFTextWidth, UnderlyingString, UseInvertedRectangle, UseTTFonts, Width, WordWrap
- From IPCB_RectangularPrimitive: IsRedundant, RotateAroundXY, Rotation, SetState_XSizeYSize, X1Location, X2Location, XLocation, Y1Location, Y2Location, YLocation
- 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