Skip to content

Menu & UI

OnMenuAction

Called when the user clicks a plugin menu item.

When is this called?

Response content varies by the menu item's resultType.

Request

Field Type Required Description
menuItemId string ID of the clicked menu item.
parentWindowHandle integer HWND for modal dialog ownership.
context PluginContext Current HydroSym state.

Response

Field Type Required Description
articleCode string Selected component article code.
description string Component description.
manufacturer string Manufacturer name.
manufacturerPartNo string Manufacturer part number.
properties map Additional properties.
filePath string File path to open.
checkOut boolean Also check out the file after opening.
projectId string Project identifier.
variables map Project variables to apply.

Example

```json { "method": "OnMenuAction", "request": {

"menuItemId": "acme-search", "parentWindowHandle": 131072, "context": "..." } } ```

```json { "result": "OK", "response": {

"articleCode": "HV-301", "description": "Directional valve 4/3, 24V DC", "manufacturer": "Bosch Rexroth", "manufacturerPartNo": "R900052271", "properties": {"key": "value"}, "filePath": "C:\Projects\valve-assembly.hsc", "checkOut": false, "projectId": "PRJ-2025-0042", "variables": {"CustomerName": "Bosch Rexroth", "Revision": "C", "DrawingNo": "VA-2025-0042"} } } ```

C# Override

public override OnMenuActionResponse OnMenuAction(OnMenuActionRequest request)
{
        // return new OnMenuActionResponse { ArticleCode = ... };
    throw new NotImplementedException();
}

JSON Schemas: Request · Response


GetMenuItemState

Query dynamic enabled/disabled/checked state of menu items.

When is this called?

Called before showing a menu containing plugin items.

Request

Field Type Required Description
menuItemIds array<string> Menu item IDs to query.
context PluginContext Current HydroSym state.

Response

Field Type Required Description
states map<string, MenuItemState> Map of menu item ID to state.

Example

```json { "method": "GetMenuItemState", "request": {

"menuItemIds": ["acme-checkout", "acme-checkin"], "context": "..." } } ```

```json { "result": "OK", "response": {

"states": "..." } } ```

C# Override

public override GetMenuItemStateResponse GetMenuItemState(GetMenuItemStateRequest request)
{
        // return new GetMenuItemStateResponse { States = ... };
    throw new NotImplementedException();
}

JSON Schemas: Request · Response


ShowSettings

Show the plugin's settings dialog.

When is this called?

Called when user clicks the auto-generated Settings menu item.

Request

Field Type Required Description
parentWindowHandle integer HWND for modal dialog ownership.
configPath string Path to the plugin's config file.
context PluginContext Current HydroSym state.

Response

Field Type Required Description
restartRequired boolean If true, HydroSym must be restarted for changes to take effect.

Example

```json { "method": "ShowSettings", "request": {

"parentWindowHandle": 131072, "configPath": "C:\ProgramData\HydroSym\plugins\acme.ini", "context": "..." } } ```

```json { "result": "OK", "response": {

"restartRequired": false } } ```

C# Override

public override ShowSettingsResponse ShowSettings(ShowSettingsRequest request)
{
        // return new ShowSettingsResponse { RestartRequired = ... };
    throw new NotImplementedException();
}

JSON Schemas: Request · Response