
# ILibCompInfoReader interface

The `ILibCompInfoReader` interface represents the object which has the list of library components (symbols) of a loaded schematic library.

```csharp
public interface ILibCompInfoReader
```

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

**Derived:** [ILibCompFullInfoReader](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/ILibCompFullInfoReader.md)

## Remarks

A Schematic library file with a SchLib extension can be loaded in the object represented by the `ILibCompInfoReader` interface and to obtain each component (Symbol), invoke the indexed ComponentInfos method. This method fetches the object which is represented by the [`IComponentInfo`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) interface.

The steps required to load a schematic library and its components.

1. Create an object and pass in the filename of a schematic library file. This object is represented by the `ILibCompInfoReader` interface. This object is created by [`ISch_ServerInterface.CreateLibCompInfoReader`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/ISch_ServerInterface.md#createlibcompinforeader).

2. Invoke the [`ILibCompInfoReader.ReadAllComponentInfo`](#readallcomponentinfo) method to load the components specified by the library name.

3. Invoke the [`ILibCompInfoReader.NumComponentInfos`](#numcomponentinfos) method to obtain the number of components for this library

4. Obtain the indexed ComponentInfos method. This ComponentInfos method returns the indexed [`IComponentInfo`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) interface.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [ComponentInfo](#componentinfo) | [IComponentInfo](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) | get | This ComponentInfos property retrieves the indexed [`IComponentInfo`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) data structure. |
| [FileName](#filename) | `string` | get | This `FileName` property gets the temporary filename of the datastructure. |

### ComponentInfo

This ComponentInfos property retrieves the indexed [`IComponentInfo`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) data structure. The `ComponentInfo` interface contains information such as component name, alias name, part count and offset for the indexed schematic symbol (component) in the library.

```csharp
IComponentInfo GetState_ComponentInfo(int argI);
```

**Type:** [IComponentInfo](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) · **Access:** read-only · **Index:** `argI` (`int`)

The accessors are extension methods of `ILibCompInfoReaderHelper` (`using SCH;`).

**See also:** [IComponentInfo](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md)

### FileName

This `FileName` property gets the temporary filename of the datastructure.

```csharp
string GetState_FileName();
```

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

**See also:** [IComponentInfo](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md)

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [NumComponentInfos](#numcomponentinfos) | `int` | This `NumComponentInfos` method retrieves the number of component information data structures. |
| [ReadAllComponentInfo](#readallcomponentinfo) | `void` | The `ReadAllComponentInfo` retrieves all the [`IComponentInfo`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) data structures for the `ILibCompInfoReader` interface. |

### NumComponentInfos

This `NumComponentInfos` method retrieves the number of component information data structures. This method is also used by the ComponentInfos property. The [`ComponentInfo`](#componentinfo) interface contains information such as component name, alias name, part count and offset for the indexed schematic symbol (component) in the library.

```csharp
int NumComponentInfos();
```

**Returns:** `int`

### ReadAllComponentInfo

The `ReadAllComponentInfo` retrieves all the [`IComponentInfo`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/IComponentInfo.md) data structures for the `ILibCompInfoReader` interface. The [`ComponentInfo`](#componentinfo) interface contains information such as component name, alias name, part count and offset for the indexed schematic symbol (component) in the library.

```csharp
void ReadAllComponentInfo();
```

**Returns:** nothing (`void`)

## Returned by

[ISch_ServerInterface.CreateLibCompInfoReader](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/ISch_ServerInterface.md#createlibcompinforeader)

## Accepted by

[ISch_ServerInterface.DestroyCompInfoReader](https://altiumdeveloper.github.io/ad-sdk-docs/reference/sch/ISch_ServerInterface.md#destroycompinforeader)
