Skip to main content
View as Markdown

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​

PropertyTypeAccessDescription
Descriptionstringget; setThe description of the embedded object, a free text.
Namestringget; setThe 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​