IPCB_Arc interface
A circular arc on a PCB document, a track segment of width LineWidth around the center (CenterX, CenterY) with Radius, from StartAngle to EndAngle.
public interface IPCB_Arc : IPCB_Primitive
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Inherits: IPCB_Primitive
Remarks
Arcs can be placed on any layer. On a signal layer an arc can be electrically connected to tracks; arcs are also used, for example, to outline component shapes.
The angles are in degrees, and the arc runs counter-clockwise from StartAngle to EndAngle. A StartAngle of 0 and an EndAngle of 360 make a full circle. The start and end points (StartX, StartY, EndX, EndY) are not stored: they are calculated from the center, the radius and the angles each time they are read.
Example
Create a new PCB document and place an arc on its bottom layer.
using DXP;
using PCB;
// Create a new PCB document.
IDXPWorkSpace workspace = DXP.GlobalVars.Client.GetDXPWorkspace();
if (workspace == null)
return;
workspace.DM_CreateNewDocument("PCB");
IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
IPCB_Board board = pcbServer.GetCurrentPCBBoard();
if (board == null)
return;
var arc = pcbServer.PCBObjectFactory(TObjectId.eArcObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Arc;
// The board origin marker must be present on the PCB document
// to obtain the board's XOrigin and YOrigin values.
arc.SetState_CenterX(EDP.Utils.MilsToCoord(board.GetState_XOrigin() + 1800));
arc.SetState_CenterY(EDP.Utils.MilsToCoord(board.GetState_YOrigin() + 1800));
arc.SetState_Radius(EDP.Utils.MilsToCoord(200));
arc.SetState_LineWidth(EDP.Utils.MilsToCoord(50));
arc.SetState_StartAngle(0);
arc.SetState_EndAngle(270);
arc.SetState_Layer(TV6_Layer.eV6_BottomLayer);
// Add the new arc object to the PCB database.
board.AddPCBObject(arc);
// Repaint the PCB document.
DXP.Utils.RunCommand("PCB:Zoom", "Action=All");
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| CenterX | int | get; set | The X coordinate of the arc's center, in internal units (10,000 per mil). |
| CenterY | int | get; set | The Y coordinate of the arc's center, in internal units (10,000 per mil). |
| EndAngle | double | get; set | The angle of the arc's end point, in degrees. |
| EndX | int | get | The X coordinate of the arc's end point, in internal units (10,000 per mil). |
| EndY | int | get | The Y coordinate of the arc's end point, in internal units (10,000 per mil). |
| LineWidth | int | get; set | The stroke width of the arc, in internal units (10,000 per mil). |
| Radius | int | get; set | The radius of the arc, in internal units (10,000 per mil). |
| StartAngle | double | get; set | The angle of the arc's start point, in degrees. |
| StartX | int | get | The X coordinate of the arc's start point, in internal units (10,000 per mil). |
| StartY | int | get | The Y coordinate of the arc's start point, in internal units (10,000 per mil). |
| StrictHitTest | bool | get | Whether a point lies on the arc. |
CenterX
The X coordinate of the arc's center, in internal units (10,000 per mil).
int GetState_CenterX();
void SetState_CenterX(int argX);
Type: int · Access: read/write
CenterY
The Y coordinate of the arc's center, in internal units (10,000 per mil).
int GetState_CenterY();
void SetState_CenterY(int argY);
Type: int · Access: read/write
EndAngle
The angle of the arc's end point, in degrees.
double GetState_EndAngle();
void SetState_EndAngle(double argngle);
Type: double · Access: read/write
EndX
The X coordinate of the arc's end point, in internal units (10,000 per mil).
int GetState_EndX();
Type: int · Access: read-only
Calculated on every read as CenterX + Radius × cos(EndAngle), rounded to an integer.
EndY
The Y coordinate of the arc's end point, in internal units (10,000 per mil).
int GetState_EndY();
Type: int · Access: read-only
Calculated on every read as CenterY + Radius × sin(EndAngle), rounded to an integer.
LineWidth
The stroke width of the arc, in internal units (10,000 per mil).
int GetState_LineWidth();
void SetState_LineWidth(int argWidth);
Type: int · Access: read/write
Radius
The radius of the arc, in internal units (10,000 per mil).
int GetState_Radius();
void SetState_Radius(int argRadius);
Type: int · Access: read/write
StartAngle
The angle of the arc's start point, in degrees.
double GetState_StartAngle();
void SetState_StartAngle(double argngle);
Type: double · Access: read/write
StartX
The X coordinate of the arc's start point, in internal units (10,000 per mil).
int GetState_StartX();
Type: int · Access: read-only
Calculated on every read as CenterX + Radius × cos(StartAngle), rounded to an integer.
StartY
The Y coordinate of the arc's start point, in internal units (10,000 per mil).
int GetState_StartY();
Type: int · Access: read-only
Calculated on every read as CenterY + Radius × sin(StartAngle), rounded to an integer.
StrictHitTest
Whether a point lies on the arc.
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).
Returns false when the arc does not belong to a board. Otherwise it returns true when the point is inside the arc's bounding rectangle and on the arc's stroke or within 10 internal units of it, and also when the point is exactly the arc's center, its start point, its end point or the middle point of the arc.
Methods
| Method | Returns | Description |
|---|---|---|
| RotateAroundXY | void | Rotates the arc about a point by an angle. |
RotateAroundXY
Rotates the arc about a point by an angle.
void RotateAroundXY(int argX, int argY, double argngle);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argX | int | value | The X coordinate of the point to rotate about, in internal units (10,000 per mil). |
argY | int | value | The Y coordinate of the point to rotate about, in internal units (10,000 per mil). |
argngle | double | value | The rotation angle, in degrees. |
Returns: nothing (void)
The center of the arc is rotated about the point, and the angle is added to both StartAngle and EndAngle. To rotate the arc without moving it, pass its own center (CenterX, CenterY) as the point.
Example: Rotate the first selected arc on the current board about its center.
using PCB;
IPCB_Board board = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (board == null || board.GetState_SelectecObjectCount() == 0)
return;
var arc = board.GetState_SelectecObject(0) as IPCB_Arc;
if (arc == null)
return;
//rotate the arc about its original center
arc.RotateAroundXY(arc.GetState_CenterX(), arc.GetState_CenterY(), 45);
Inherited members
- 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
Returned by
IPCB_AngularDimension.Arc1, IPCB_AngularDimension.Arc2, IPCB_LeaderDimension.Circle_Arc, IPCB_LeaderDimension.Dot_Arc
Accepted by
IPCB_ContourMaker.MakeContour_5, IPCB_ContourMaker2.MakeContour_15