
# IPCB_ObjectClass2 interface

A class on a PCB document, with members in addition to [`IPCB_ObjectClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md) for the display name, the number of members, the membership of a design object and the members of a class that holds other classes.

```csharp
public interface IPCB_ObjectClass2 : IPCB_ObjectClass
```

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

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

## Remarks

A class that holds other classes is one whose [`MemberKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#memberkind) is `TClassMemberKind.eClassMemberKind_ObjectClass` or `TClassMemberKind.eClassMemberKind_xNetClass`. Its members are listed by kind with [`MembersCountByKind`](#memberscountbykind) and [`MemberName_1`](#membername_1); for any other class those two members return 0 and an empty string.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [DisplayName](#displayname) | `string` | get | The name of the class for display. |
| [MemberName_1](#membername_1) | `string` | get | The name of a member of a class that holds other classes, by the member's kind. |
| [MembersCount](#memberscount) | `int` | get | The number of members of the class. |
| [MembersCountByKind](#memberscountbykind) | `int` | get | The number of member classes of one kind in a class that holds other classes. |

### DisplayName

The name of the class for display.

```csharp
string GetState_DisplayName();
```

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

The same as `Name`, or `Name` in angle brackets (`<` and `>`) for a class whose [`SuperClass`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#superclass) is true. A class that holds other classes gets the angle brackets only when its [`MemberKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#memberkind) is `TClassMemberKind.eClassMemberKind_xNetClass`. The SDK examples report each xSignal class by its display name.

### MemberName_1

The name of a member of a class that holds other classes, by the member's kind.

```csharp
string GetState_MemberName_1(TClassMemberKind argKind, int argI);
```

**Type:** `string` · **Access:** read-only · **Index:** `argKind` ([TClassMemberKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TClassMemberKind.md)): The [`MemberKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#memberkind) of the member classes to list., `argI` (`int`): The index of the member among the members of that kind, from 0 to [`MembersCountByKind`](#memberscountbykind) - 1 for the same kind.

The accessors are extension methods of `IPCB_ObjectClass2Helper` (`using PCB;`).

Returns an empty string for a class that does not hold other classes, and when the index is outside the members of that kind.

### MembersCount

The number of members of the class.

```csharp
int GetState_MembersCount();
```

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

For a class that holds other classes, the member classes of all kinds are counted. For any other class the value is the number of stored member names, which is also the number of indexes [`MemberName`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#membername) accepts.

### MembersCountByKind

The number of member classes of one kind in a class that holds other classes.

```csharp
int GetState_MembersCountByKind(TClassMemberKind argKind);
```

**Type:** `int` · **Access:** read-only · **Index:** `argKind` ([TClassMemberKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TClassMemberKind.md)): The [`MemberKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#memberkind) of the member classes to count.

The accessors are extension methods of `IPCB_ObjectClass2Helper` (`using PCB;`).

Returns 0 for a class that does not hold other classes, and when the class has no members of that kind.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [IsMember_1](#ismember_1) | `bool` | Returns whether a design object is a member of the class. |

### IsMember_1

Returns whether a design object is a member of the class.

```csharp
bool IsMember_1(IPCB_Primitive argP);
bool IsMember_1(object argP);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argP` | [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) | value | The design object to test. |

**Returns:** `bool`

The first overload is an extension method of `IPCB_ObjectClass2Helper` (`using PCB;`) with typed parameters; the second is declared by the interface.

For a class that holds objects other than classes, the result is the same as [`IsMember`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#ismember) for the object's `Identifier`; automatically generated component classes, such as the classes of the components on the top or the bottom side, decide from the component itself. For a class that holds other classes, the object must be a class that [`IsValidObjectKind`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#isvalidobjectkind) accepts and whose name is among the members of its kind; a class is never a member of itself.

## Inherited members

- From [IPCB_ObjectClass](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md): [AddLayerMember](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#addlayermember), [AddMember](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#addmember), [AddMemberByName](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#addmemberbyname), [IsLayerMember](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#islayermember), [IsMember](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#ismember), [IsValidObjectKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#isvalidobjectkind), [MemberKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#memberkind), [MemberName](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#membername), [Name](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#name), [RemoveAllMembers](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#removeallmembers), [RemoveLayerMember](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#removelayermember), [RemoveMember](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#removemember), [SuperClass](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ObjectClass.md#superclass)
- 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)
