> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 外部アセンブリ

> Scanning Station のスクリプトやグローバルモジュールに .NET アセンブリをアタッチできます。バッチタイプごと、またはグローバルに設定できます。

スクリプトやグローバルモジュールで、外部アセンブリを使用できます。標準アセンブリとユーザーがコンパイルしたアセンブリの両方がサポートされています。アタッチしたアセンブリ内のすべてのクラスとメソッドを、スクリプトで利用できます。

<div id="where-to-attach-an-assembly">
  ## アセンブリを追加する場所
</div>

アセンブリは次の 2 か所に追加できます。

* [Batch Type Properties](/ja/vantage/documentation/scanning-station/interface/batch-type-properties-dbox)ダイアログの **Scripts** タブ — アセンブリはそのバッチタイプでのみ利用できます。
* **Tools > Options…** — アセンブリをすべてのスクリプトとグローバルモジュールで共通して利用できます。

<div id="attach-an-assembly">
  ## アセンブリをアタッチする
</div>

1. **Project Properties** ダイアログを開き、**Scripts** タブをクリックして、**References .NET…** をクリックします。
2. 開いたダイアログで、**Add…** をクリックします。
3. **Add Assembly** ダイアログで、型 field でソースを選択します。
   * **Attached file** — ファイルのパスを指定します。
   * **Standard assembly name** — 標準名を指定します。

<div id="example">
  ## 例
</div>

以下は、名前空間、クラス、メソッドを含むアセンブリのサンプルです。

```csharp theme={null}
namespace TestNameSpace
{
    public class Test
    {
        public void Show(string text)
        {
            // 静的メソッド System.Windows.Forms.MessageBox.Show(string) を使用してメッセージを表示します。
            System.Windows.Forms.MessageBox.Show(text);
        }
    }
}
```

スクリプトでこのクラスを使用するには:

```csharp theme={null}
TestNameSpace.Test test = new TestNameSpace.Test(); // Testのインスタンスを作成する
test.Show("Hello world"); // Showメソッドを呼び出す
```

<div id="related-topics">
  ## 関連トピック
</div>

* [スクリプトの使用](/ja/vantage/documentation/scanning-station/admin/using-scripts)
* [.NET 言語のスクリプト](/ja/vantage/documentation/scanning-station/admin/specific-net-scripts)
* [Batch Type Properties ダイアログ](/ja/vantage/documentation/scanning-station/interface/batch-type-properties-dbox)
* [管理者モード](/ja/vantage/documentation/scanning-station/admin/admin-mode)
