www.kxcad.net Home > Electronic Index > Altium(Protel) Index
Overview
The IPC_Board interface encapsulates an opened PCB document in DXP and from this board interface object, you can add, delete PCB design objects, find out which layers are used and so on.
Important Notes
Check if the PCB server exists and if there is a PCB document before you do any PCB API calls.
The caller needs to kill the NetsList (which is a StringList) object after use, do not kill the Net objects when using the GetState_SplitPlaneNets method.
Some properties are only read only, meaning you can only retrieve data from property but not modify the data.
To create a new object and add to the board object, firstly invoke the PCBObjectFactory from the IPCB_ServerInterface interface and then invoke the AddPCBObject method from a IPCB_Board interface.
IPCB_Board Methods
Function IsLibrary : Boolean;
Function WindowBoundingRectangle : TCoordRect;
Function LayerPositionInSet (ALayerSet : TLayerSet;
ALayerObj : IPCB_LayerObject) : Integer;
Function BoardIterator_Create : IPCB_BoardIterator;
Procedure BoardIterator_Destroy (Var AIterator : IPCB_BoardIterator);
Function LibraryIterator_Create : IPCB_LibraryIterator;
Procedure LibraryIterator_Destroy (Var AIterator : IPCB_LibraryIterator);
Function SpatialIterator_Create : IPCB_SpatialIterator;
Procedure SpatialIterator_Destroy (Var AIterator : IPCB_SpatialIterator);
Procedure AddPCBObject (PCBObject : IPCB_Primitive);
Procedure RemovePCBObject (PCBObject : IPCB_Primitive);
Function GetPrimitiveCount(AObjSet : TObjectSet;
LayerSet : TLayerSet;
AMethod : TIterationMethod) :Integer;
Procedure GetState_SplitPlaneNets (NetsList : TStringList);
IPCB_Board Properties
Property PCBWindow : HWND // Read only property.
Property FileName : TString // Read only property
Property XOrigin : TCoord
Property YOrigin : TCoord
Property XCursor : TCoord
Property YCursor : TCoord
Property DisplayUnit : TUnit
Property CurrentLayer : TLayer // Read only property
Property LayerStack : IPCB_LayerStack // Read only property
Property LayerColor [L : TLayer] : TColorRef // Read only property
Property SnapGridUnit : TUnit
Property BigVisibleGridUnit : TUnit
Property VisibleGridUnit : TUnit
Property BigVisibleGridSize : TReal
Property VisibleGridSize : TReal
Property SnapGridSize : TDouble
Property SnapGridSizeX : TDouble
Property SnapGridSizeY : TDouble
Property TrackGridSize : TDouble
Property ViaGridSize : TDouble
Property ComponentGridSize : TDouble
Property ComponentGridSizeX : TDouble
Property ComponentGridSizeY : TDouble
Property DrawDotGrid : Boolean
// Options Interfaces inherited by the IPCB_AbstractOptions interface.
Property OutputOptions : IPCB_OutputOptions // Read only
Property ECOOptions : IPCB_ECOOptions // Read only
Property GerberOptions : IPCB_GerberOptions // Read only
Property PrinterOptions : IPCB_PrinterOptions // Read only
Property PlacerOptions : IPCB_AdvancedPlacerOptions // Read only
//
Property LayerIsDisplayed [L : TLayer] : Boolean
Property LayerIsUsed [L : TLayer] : Boolean
Property InternalPlaneNetName [L : TLayer] : TNetName
Property InternalPlane1NetName : TNetName
Property InternalPlane2NetName : TNetName
Property InternalPlane3NetName : TNetName
Property InternalPlane4NetName : TNetName
Property DrillLayerPairsCount : Integer // Read only
Property LayerPair [I : Integer] : IPCB_DrillLayerPair // Read only
Property MechanicalPairs : IPCB_MechanicalLayerPairs // Read only
Property BoardOutline : IPCB_BoardOutline // Read only
Property AutomaticSplitPlanes : Boolean;
Example
Var
PCBBoard : IPCB_Board;
Layer : TLayer;
LS : String;
Begin
PCBBoard := PCBServer.GetCurrentPCBBoard;
If PCBBoard = Nil Then Exit;
LS := '';
(* Check for each signal layer for used/display setting *)
For Layer := eTopLayer to eMultiLayer Do
If PCBBoard.LayerIsUsed[Layer] Then
If PCBBoard.LayerIsDisplayed[Layer] Then
LS := LS + Layer2String(Layer) + ' used and displayed' + #13
Else
LS := LS + Layer2String(Layer) + ' used but not displayed' + #13;
(* Show the results *)
ShowInfo(LS);
End;
See also
TNetName value
TLayer enumerated values
IPCB_LayerStack interface
IPCB_ECOOptions interface
IPCB_GerberOptions interface
IPCB_PrinterOptions interface
IPCB_AdvancedPlacerOptions interface