Skip to main content
View as Markdown

IPCB_Sheet interface

The sheet of a PCB document, the rectangular area behind the board in the PCB editor that can hold the board outline and fabrication and assembly details, returned by IPCB_Board.PCBSheet.

public interface IPCB_Sheet

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Remarks​

The sheet extends from (SheetX, SheetY) by SheetWidth to the right and SheetHeight upwards, in internal units (10,000 per mil). ShowSheet sets whether it is drawn; when LockSheet is true, UpdateSheetPosition fits it to the objects on the mechanical layers linked to the sheet.

The sheet of a new board is at (1000 mil, 1000 mil), 10000 mil wide and 8000 mil high, not shown (ShowSheet is false) and locked (LockSheet is true).

Properties​

PropertyTypeAccessDescription
LockSheetboolget; setWhether the sheet is fitted to the objects on the mechanical layers linked to it.
SheetHeightintget; setThe height of the sheet, in internal units (10,000 per mil).
SheetWidthintget; setThe width of the sheet, in internal units (10,000 per mil).
SheetXintget; setThe X coordinate of the sheet's bottom-left corner, in internal units (10,000 per mil).
SheetYintget; setThe Y coordinate of the sheet's bottom-left corner, in internal units (10,000 per mil).
ShowSheetboolget; setWhether the sheet is drawn in the PCB editor.

LockSheet​

Whether the sheet is fitted to the objects on the mechanical layers linked to it.

bool GetState_LockSheet();
void SetState_LockSheet(bool argValue);

Type: bool · Access: read/write

When true, UpdateSheetPosition moves and resizes the sheet to enclose those objects; when false, UpdateSheetPosition does not change the sheet.

See also: IPCB_MechanicalLayer.LinkToSheet

SheetHeight​

The height of the sheet, in internal units (10,000 per mil).

int GetState_SheetHeight();
void SetState_SheetHeight(int argValue);

Type: int · Access: read/write

The top edge of the sheet is at SheetY plus this value.

SheetWidth​

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

int GetState_SheetWidth();
void SetState_SheetWidth(int argValue);

Type: int · Access: read/write

The right edge of the sheet is at SheetX plus this value.

SheetX​

The X coordinate of the sheet's bottom-left corner, in internal units (10,000 per mil).

int GetState_SheetX();
void SetState_SheetX(int argValue);

Type: int · Access: read/write

SheetY​

The Y coordinate of the sheet's bottom-left corner, in internal units (10,000 per mil).

int GetState_SheetY();
void SetState_SheetY(int argValue);

Type: int · Access: read/write

ShowSheet​

Whether the sheet is drawn in the PCB editor.

bool GetState_ShowSheet();
void SetState_ShowSheet(bool argValue);

Type: bool · Access: read/write

Example: Show the properties of the current board and its sheet.

using PCB;

IPCB_Board board = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (board == null)
return;
string aShowSheet = board.GetState_PCBSheet().GetState_ShowSheet().ToString();
string aLockSheet = board.GetState_PCBSheet().GetState_LockSheet().ToString();
string unit = board.GetState_DisplayUnit() == TUnit.eImperial ? "Imperial (mil)" : "Metric (mm)";
DXP.Utils.ShowMessage(
"Window Handle = " + board.GetState_Window() + "\r" +
"Board Filename =" + board.GetState_FileName() + "\r" +
"Origin X = " + board.GetState_XOrigin() + "\r" +
"Origin Y = " + board.GetState_YOrigin() + "\r" +
"Board Units = " + unit + "\r" +
"Current layer = " + EDP.Utils.LayerToString(new V7_Layer(board.GetState_CurrentLayer())) + "\r" +
"Sheet.X = " + board.GetState_PCBSheet().GetState_SheetX() + "\r" +
"Sheet.Y = " + board.GetState_PCBSheet().GetState_SheetY() + "\r" +
"Sheet.Height = " + board.GetState_PCBSheet().GetState_SheetHeight() + "\r" +
"Sheet.Width = " + board.GetState_PCBSheet().GetState_SheetWidth() + "\r" +
"Sheet is shown = " + aShowSheet + "\r" +
"Sheet is locked = " + aLockSheet);

Methods​

MethodReturnsDescription
UpdateSheetPositionvoidFits the sheet to the objects on the mechanical layers linked to the sheet, when LockSheet is true.

UpdateSheetPosition​

Fits the sheet to the objects on the mechanical layers linked to the sheet, when LockSheet is true.

void UpdateSheetPosition();

Returns: nothing (void)

Sets SheetX and SheetY to the bottom-left corner of the bounding rectangle of the objects on the mechanical layers linked to the sheet (IPCB_MechanicalLayer.LinkToSheet), and SheetWidth and SheetHeight to its size. The sheet is not changed when LockSheet is false or when no objects are found on those layers.

Returned by​

IPCB_Board.PCBSheet