IPCB_Embedded interface
An embedded object in a PCB document, an object that is not visible and stores information in the document.
public interface IPCB_Embedded : IPCB_Primitive
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Inherits: IPCB_Primitive
Remarks
The information an embedded object stores is saved in the PCB document file when the file is saved. Each embedded object is identified by its Name, and its Description can be used to store information.
Example
Add an embedded object with a name and a description to the current board.
using PCB;
// Check that a PCB board exists.
IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
IPCB_Board board = pcbServer?.GetCurrentPCBBoard();
if (board == null)
{
DXP.Utils.ShowWarning("This document is not a PCB document!", "Embedded Object");
return;
}
// Create the embedded object.
var embeddedObject = pcbServer.PCBObjectFactory(TObjectId.eEmbeddedObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Embedded;
embeddedObject.SetState_Name("Embedded Object Name");
embeddedObject.SetState_Description("Embedded object can store many chars.");
board.AddPCBObject(embeddedObject);
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| Description | string | get; set | The description of the embedded object, a free text. |
| Name | string | get; set | The name that identifies the embedded object. |
Description
The description of the embedded object, a free text.
string GetState_Description();
void SetState_Description(string argValue);
Type: string · Access: read/write
The description can be used to store data that represents this embedded object.
Name
The name that identifies the embedded object.
string GetState_Name();
void SetState_Name(string argValue);
Type: string · Access: read/write
Example: Show the name and description of every embedded object on the current board.
using PCB;
IPCB_Board board = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (board == null)
return;
IPCB_BoardIterator iterator = board.BoardIterator_Create();
iterator.AddFilter_ObjectSet(new PCB.TObjectSet { TObjectId.eEmbeddedObject });
iterator.AddFilter_AllLayers();
iterator.AddFilter_Method(TIterationMethod.eProcessAll);
for (var embedded = iterator.FirstPCBObject() as IPCB_Embedded; embedded != null; embedded = iterator.NextPCBObject() as IPCB_Embedded)
{
DXP.Utils.ShowInfo("Name : " + embedded.GetState_Name() + "\r\n" +
"Description : " + embedded.GetState_Description(), "Embedded Object");
}
board.BoardIterator_Destroy(ref iterator);
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