Menus
Menus are used to add menu items to the existing context menus on 3D equipment (below the Properties entry).
A context menu is displayed at the mouse location when the user Right clicks on the equipment.
Create a new Menu
From the Project Explorer Panel use Right click over the entry Menu and select New.
A new Menu is created with a default name of ‘Menu1’ where the number increments for each new Menu and you are able to rename the Menu at this stage.
Edit Menu properties
If the Property Editor is not displayed, click on Ribbon > Home > Property Editor to open the Property Editor. When the Menu is selected its properties will be displayed in the Property Editor Window allowing you to make changes.
Delete a Menu
Use Right click on a Menu or a group of Menus and select Delete from the menu. You will be asked to confirm the deletion.
Rename a Menu
Use Right click on a Menu and select Rename from the menu. You can enter the new name.
Assign a Menu to 3DView
Use can click on 3DView and assign a menu using the menu drop down property.
Properties
- Name: Name of the Menu. This name must be unique in the list of Menus.
- Items:
- Add a new Menu item (+): Add a new menu item. Defaults to ‘Text’
- Add a new separator (±): Inserts a separator line in the menu
- Delete selected menu item (-): Delete the selected menu item
- Move up selected menu item (⇧): Move the selected item up
- Move down selected menu item (⇩): Move the selected item down
- Default Action check box: Appear only when select first item in the menu. Once tick, the first item set as default action, which get executed when Left-Click on assigned equipment.
- Text: The text to use when the user Right clicks over the object that has this menu attached to it.
- Action: The properties available depends upon the Action selected.
Example 1
Call a simulation script function using the ‘Execute Macro’ action. The example for option 2 may be:
Project.CallSimulationScriptFunction("MyMenu", Caller, 2);
The script function may be defined as follows:
function MyMenu(caller, parameter) {
LogDebug("MyMenu called: " + caller.Name + " and parameter=" + parameter);
}
When a menu option is selected the caller will be the equipment then parameter will be the parameter passed.
Example 2
Calling simulation script function.
function Color(caller, parameter)
{
caller.SurfaceColor = "Sym3 Red"
LogDebug("caller = " + caller.SurfaceColor );
LogDebug("parameter = " + parameter);
}