NextDesign.Interop
1.1.2.10908
dotnet add package NextDesign.Interop --version 1.1.2.10908
NuGet\Install-Package NextDesign.Interop -Version 1.1.2.10908
<PackageReference Include="NextDesign.Interop" Version="1.1.2.10908" />
<PackageVersion Include="NextDesign.Interop" Version="1.1.2.10908" />
<PackageReference Include="NextDesign.Interop" />
paket add NextDesign.Interop --version 1.1.2.10908
#r "nuget: NextDesign.Interop, 1.1.2.10908"
#:package NextDesign.Interop@1.1.2.10908
#addin nuget:?package=NextDesign.Interop&version=1.1.2.10908
#tool nuget:?package=NextDesign.Interop&version=1.1.2.10908
1. 概要
- Next Design を外部アプリケーションから制御するための.NETライブラリです。
- 制御対象の Next Design には
NDInteropエクステンションのインストールが必要です。
2. インストール方法
コマンドプロンプトより次のように実行してください。
> dotnet add package NextDesign.Interop
3. 利用方法
制御は Next Design のスクリプトを呼び出すことによって実現します。スクリプトでプロジェクトファイルを読み込んだり、保存したりエラーチェックをしたり、UI の状態を変更できます。また、UI の状態を戻り値で返すことで連続的な操作も可能です。
インストールしている Next Design を新規に起動する場合は NextDesignAppFactory.Start() を用います。Next Design のプロジェクトファイルが関連づいている Next Design のプログラムのパスを自動的に検索して起動します。
using NextDesign.Interop;
using NextDesign.Interop.Interfaces;
// インストールしている Next Design を起動します。
var ndApp = NextDesignAppFactory.Start();
var ret = ndApp.RunScript("return Version;");
Console.WriteLine(ret.ReturnValue);
Next Design のアプリケーションのパスを指定しての実行も可能です。
using NextDesign.Interop;
using NextDesign.Interop.Interfaces;
var ndApp = NextDesignAppFactory.Start(@"C:\Program Files\....\NextDesign.exe");
var ret = ndApp.RunScript("return Version;");
Console.WriteLine(ret.ReturnValue);
起動している Next Design にアタッチする場合は NextDesignAppFactory.Attach() メソッドを用います。NextDesignAppFactory.AttachOrStart() を用いれば、プロセスがあればアタッチしてなければ自動的に起動します。
using NextDesign.Interop;
using NextDesign.Interop.Interfaces;
// 複数起動している場合はプロセスIdが一番大きい(新しいプロセス)にアタッチします
var ndApp = NextDesignAppFactory.Attach();
var ret = ndApp.RunScript("return Version;");
Console.WriteLine(ret.ReturnValue);
特定のプロセスにアタッチする場合は Process や processId を渡します。
using NextDesign.Interop;
using NextDesign.Interop.Interfaces;
using System.Diagnostics;
var process = Process.Start(@"C:\Program Files\....\NextDesign.exe");
var ndApp = NextDesignAppFactory.Attach(process);
var ret = ndApp.RunScript("return Version;");
特定の Next Design のプロセスを探してアタッチする場合は次のようにします。
using NextDesign.Interop;
using NextDesign.Interop.Interfaces;
var projectFile = "...";
var processes = NextDesignAppFactory.GetNextDesignProcesses();
INextDesignApp app = null;
foreach (var process in processes)
{
var ndApp = NextDesignAppFactory.Attach(process);
if (ndApp.CurrentProjectFilePath == projectFile)
{
app = ndApp;
break;
}
}
var result = app.RunScript("...");
if (!result.IsSuccess)
{
Console.WriteLine($"エラーが発生しました。{result.ErrorMessage}");
}
else
{
// スクリプトに戻り値があれば `RunScriptResult.ReturnValue` プロパティで取得できます。
Console.WriteLine($"[成功] {result.ReturnValue}");
}
実行中の Next Design の指定プロセスにアタッチするか、なければ起動する場合は次のようにします。
using NextDesign.Interop;
using NextDesign.Interop.Interfaces;
// 複数起動している場合はプロセスIdが一番大きい(新しいプロセス)にアタッチします
var ndApp = NextDesignAppFactory.AttachOrStart();
var ret = ndApp.RunScript("return Version;");
Console.WriteLine(ret.ReturnValue);
実行結果は RunScriptResult オブジェクトで取得できます。
using NextDesign.Interop.Interfaces;
var result = app.RunScript("...");
if (!result.IsSuccess)
{
Console.WriteLine($"エラーが発生しました。{result.ErrorMessage}");
}
else
{
// スクリプトに戻り値があれば `RunScriptResult.ReturnValue` プロパティで取得できます。
Console.WriteLine($"[成功] {result.ReturnValue}");
}
必要に応じて、Start() で新規起動したり、Attach() で既存プロセスに接続したりできます。
4. パッケージのアンインストール方法
次のコマンドを実行してください。
> dotnet remove package NextDesign.Interop
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- EasyPipes (>= 1.3.0)
- Microsoft.Win32.Registry (>= 5.0.0)
- NextDesign.Interop.Interfaces (>= 1.1.1.10908)
- System.Text.Json (>= 9.0.1)
- System.Text.RegularExpressions (>= 4.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.2.10908 | 100 | 9/29/2026 |
| 1.1.1.10306 | 333 | 9/29/2026 |
| 1.1.0.41031 | 654 | 9/29/2026 |
### 1.1.2
- 脆弱性対策として `System.Text.RegularExpressions` 4.3.1 を追加。
## 1.1.1
- 新規公開