Quick Start¶
Build a plugin that adds a Search menu item and shows a message when clicked. Once that works, the last section adds title-block syncing.
Prerequisites¶
- Windows 10 or later.
- .NET 8 SDK or later: plugins target
net8.0-windows. - Visual C++ build tools (MSVC): required for NativeAOT. Install "Desktop development with C++" from the Visual Studio Installer.
- HydroSym 2026 or later: Plugin API v1.
- PARO HydroSym SDK packages: the
PARO.HydroSym.Plugintemplate and thePARO.HydroSym.PluginSDKlibrary.
HydroSym is a 32-bit application, so the plugin is published as win-x86.
1. Create the project¶
The template gives you MyPlugin.cs, a Startup.cs that registers the plugin, and a .csproj with the NativeAOT settings.
Without the template: create a net8.0-windows class library, add a PackageReference to PARO.HydroSym.PluginSDK, set the .csproj properties listed in Build & Deploy, and register your plugin class once:
using System.Runtime.CompilerServices;
using PARO.HydroSym.PluginSDK;
internal static class Startup
{
[ModuleInitializer]
internal static void Init() => PluginRegistration.Register(new MyPlugin());
}
Without PluginRegistration.Register, the plugin fails to load with "No plugin registered".
2. Implement GetInfo¶
GetInfo is called first. It declares your plugin name, capabilities, and menu items.
using PARO.HydroSym.PluginSDK;
using PARO.HydroSym.PluginSDK.Models;
public class MyPlugin : HydroSymPluginBase
{
public override GetInfoResponse GetInfo() => new()
{
Name = "My Plugin",
Vendor = "Your Company",
Version = "1.0.0",
ApiVersion = 1,
Capabilities = DeriveCapabilities(),
Menus =
[
new MenuItem
{
Id = "my-search",
Label = "&Search...",
Location = "plugin",
}
],
};
}
DeriveCapabilities() lists the optional methods you override. A menu-only plugin gets []. Menu methods are not capability-gated. If an optional method such as BeforeFileClose never runs, its capability is missing from the list; keep Capabilities = DeriveCapabilities(). See Architecture.
Location = "plugin" puts the item under a top-level menu named after your plugin. See Menu Integration.
3. Handle OnMenuAction¶
public override void OnMenuAction(OnMenuActionRequest request)
{
if (request.MenuItemId != "my-search")
return;
Host.ShowMessage("Hello from MyPlugin");
}
4. Implement Initialize (optional)¶
public override void Initialize(InitializeRequest request)
{
// request.ConfigPath is the ConfigPath value from HydroSym.ini [Plugin]
// request.HostDataPath is %APPDATA%\PARO\HydroSym\
// request.HostVersion is the HydroSym display version, for example "2026"
}
5. Build and deploy¶
Copy MyPlugin.dll from bin/Release/net8.0-windows/win-x86/publish/ into a folder such as C:\ProgramData\PARO\HydroSym\Plugins\MyPlugin\. Then register it in %APPDATA%\PARO\HydroSym\Ini\HydroSym.ini:
[Plugin]
Enabled=1
DllPath=C:\ProgramData\PARO\HydroSym\Plugins\MyPlugin\MyPlugin.dll
ConfigPath=C:\ProgramData\PARO\HydroSym\Plugins\MyPlugin\plugin.ini
Use an absolute path for DllPath; environment variables are not expanded. See Build & Deploy for the full layout.
6. Verify¶
Restart HydroSym. A menu named My Plugin appears at the right end of the menu bar. Click Search... and confirm the message appears.
If the menu does not appear, HydroSym shows a warning dialog at startup with the load error. See Build & Deploy → Troubleshooting.
Title-block fields¶
After the menu works, override GetProjectVariables to return title-block keys. HydroSym calls it when a schematic opens and writes the keys into the schematic's attribute list. DeriveCapabilities() then includes getProjectVariables automatically.
public override GetProjectVariablesResponse GetProjectVariables(
GetProjectVariablesRequest request)
{
return new GetProjectVariablesResponse
{
Variables = new Dictionary<string, string>
{
["CustomerName"] = "Bosch Rexroth",
["Revision"] = "C",
["DrawingNumber"] = "VA-2025-0042",
}
};
}
If this method throws during file open, HydroSym logs the error and still opens the file. The user sees no dialog, and Release builds of HydroSym keep no log, so log from the plugin if you need to diagnose this. See Error Handling.
Next steps¶
- Build & Deploy: INI registration, paths, troubleshooting
- Host API:
Host.GetBom(), drawing PDF, rules - Menu Integration: settings dialog (
HasSettings,ShowSettings) - Workflows: when each method is called
- PDM integration / ERP integration
- API Reference: field-level schemas