
# IPCB_Arc interface

A circular arc on a PCB document, a track segment of width [`LineWidth`](#linewidth) around the center ([`CenterX`](#centerx), [`CenterY`](#centery)) with `Radius`, from [`StartAngle`](#startangle) to [`EndAngle`](#endangle).

```csharp
public interface IPCB_Arc : IPCB_Primitive
```

**Namespace:** PCB · **Assembly:** Altium.SDK.Interfaces

**Inherits:** [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md)

## 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`](#startangle) to [`EndAngle`](#endangle). A [`StartAngle`](#startangle) of 0 and an [`EndAngle`](#endangle) of 360 make a full circle. The start and end points ([`StartX`](#startx), [`StartY`](#starty), [`EndX`](#endx), [`EndY`](#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.

```csharp
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](#centerx) | `int` | get; set | The X coordinate of the arc's center, in internal units (10,000 per mil). |
| [CenterY](#centery) | `int` | get; set | The Y coordinate of the arc's center, in internal units (10,000 per mil). |
| [EndAngle](#endangle) | `double` | get; set | The angle of the arc's end point, in degrees. |
| [EndX](#endx) | `int` | get | The X coordinate of the arc's end point, in internal units (10,000 per mil). |
| [EndY](#endy) | `int` | get | The Y coordinate of the arc's end point, in internal units (10,000 per mil). |
| [LineWidth](#linewidth) | `int` | get; set | The stroke width of the arc, in internal units (10,000 per mil). |
| [Radius](#radius) | `int` | get; set | The radius of the arc, in internal units (10,000 per mil). |
| [StartAngle](#startangle) | `double` | get; set | The angle of the arc's start point, in degrees. |
| [StartX](#startx) | `int` | get | The X coordinate of the arc's start point, in internal units (10,000 per mil). |
| [StartY](#starty) | `int` | get | The Y coordinate of the arc's start point, in internal units (10,000 per mil). |
| [StrictHitTest](#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).

```csharp
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).

```csharp
int GetState_CenterY();
void SetState_CenterY(int argY);
```

**Type:** `int` · **Access:** read/write

### EndAngle

The angle of the arc's end point, in degrees.

```csharp
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).

```csharp
int GetState_EndX();
```

**Type:** `int` · **Access:** read-only

Calculated on every read as [`CenterX`](#centerx) + `Radius` × cos([`EndAngle`](#endangle)), rounded to an integer.

### EndY

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

```csharp
int GetState_EndY();
```

**Type:** `int` · **Access:** read-only

Calculated on every read as [`CenterY`](#centery) + `Radius` × sin([`EndAngle`](#endangle)), rounded to an integer.

### LineWidth

The stroke width of the arc, in internal units (10,000 per mil).

```csharp
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).

```csharp
int GetState_Radius();
void SetState_Radius(int argRadius);
```

**Type:** `int` · **Access:** read/write

### StartAngle

The angle of the arc's start point, in degrees.

```csharp
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).

```csharp
int GetState_StartX();
```

**Type:** `int` · **Access:** read-only

Calculated on every read as [`CenterX`](#centerx) + `Radius` × cos([`StartAngle`](#startangle)), rounded to an integer.

### StartY

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

```csharp
int GetState_StartY();
```

**Type:** `int` · **Access:** read-only

Calculated on every read as [`CenterY`](#centery) + `Radius` × sin([`StartAngle`](#startangle)), rounded to an integer.

### StrictHitTest

Whether a point lies on the arc.

```csharp
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](#rotatearoundxy) | `void` | Rotates the arc about a point by an angle. |

### RotateAroundXY

Rotates the arc about a point by an angle.

```csharp
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`](#startangle) and [`EndAngle`](#endangle). To rotate the arc without moving it, pass its own center ([`CenterX`](#centerx), [`CenterY`](#centery)) as the point.

**Example:** Rotate the first selected arc on the current board about its center.

```csharp
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](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md): [AllowGlobalEdit](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#allowglobaledit), [BeginModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#beginmodify), [Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#board), [BoundingRectangle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangle), [BoundingRectangleChildren](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectanglechildren), [BoundingRectangleForPainting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforpainting), [BoundingRectangleForSelection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforselection), [CancelModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#cancelmodify), [Component](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#component), [Coordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#coordinate), [DescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#descriptorstring), [DetailString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#detailstring), [Dimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#dimension), [DrawAsPreview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drawaspreview), [DRCError](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drcerror), [Enabled](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled), [Enabled_Direct](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_direct), [Enabled_vComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcomponent), [Enabled_vCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcoordinate), [Enabled_vDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vdimension), [Enabled_vNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vnet), [Enabled_vPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vpolygon), [EnableDraw](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabledraw), [EndModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#endmodify), [Export_ToParameters](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#export_toparameters), [FlipXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#flipxy), [GraphicallyInvalidate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#graphicallyinvalidate), [Handle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#handle), [Identifier](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#identifier), [InBoard](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inboard), [InComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incomponent), [InCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incoordinate), [Index](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#index), [InDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#indimension), [InNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#innet), [InPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inpolygon), [InSelectionMemory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inselectionmemory), [IsAssyTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_bottom), [IsAssyTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_top), [IsElectricalPrim](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iselectricalprim), [IsFreePrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isfreeprimitive), [IsHidden](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ishidden), [IsKeepout](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iskeepout), [IsPreRoute](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ispreroute), [IsSaveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#issaveable), [IsTenting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting), [IsTenting_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_bottom), [IsTenting_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_top), [IsTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_bottom), [IsTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_top), [Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#layer), [MiscFlag1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag1), [MiscFlag2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag2), [MiscFlag3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag3), [Moveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#moveable), [MoveByXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movebyxy), [MoveToXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movetoxy), [Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#net), [ObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectid), [ObjectIDString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectidstring), [PadCacheRobotFlag](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#padcacherobotflag), [PasteMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#pastemaskexpansion), [Polygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygon), [PolygonOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygonoutline), [PowerPlaneClearance](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneclearance), [PowerPlaneConnectStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneconnectstyle), [PowerPlaneReliefExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplanereliefexpansion), [Preview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#preview), [ReliefAirGap](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefairgap), [ReliefConductorWidth](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefconductorwidth), [ReliefEntries](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefentries), [Replicate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#replicate), [RequiredParamterSpace](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#requiredparamterspace), [RotateBy](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#rotateby), [Selected](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#selected), [SolderMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#soldermaskexpansion), [SwapLayerPairs](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#swaplayerpairs), [TearDrop](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#teardrop), [UnionIndex](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#unionindex), [UniqueId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid), [UniqueID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid-1), [Used](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#used), [UserRouted](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#userrouted), [V7Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#v7layer), [ViewableObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#viewableobjectid)

## Returned by

[IPCB_AngularDimension.Arc1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_AngularDimension.md#arc1), [IPCB_AngularDimension.Arc2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_AngularDimension.md#arc2), [IPCB_LeaderDimension.Circle_Arc](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LeaderDimension.md#circle_arc), [IPCB_LeaderDimension.Dot_Arc](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_LeaderDimension.md#dot_arc)

## Accepted by

[IPCB_ContourMaker.MakeContour_5](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_5), [IPCB_ContourMaker2.MakeContour_15](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_15)
