Skip to main content
13-Aquamarine
June 21, 2016
Solved

With an ACL function, how to add a menu when Arbortex Editor starts

  • June 21, 2016
  • 1 reply
  • 1843 views

Hello,

I tried to add a menu using an ACL function in a script file init.acl (C:\Program Files\PTC\Arbortext Editor\custom\init\init.acl) but the menu is not loaded.

I want the menu to load when Arbortext Editor is starting.

Script:

function load_menu() {}
function load_menu() {

mad -before ".File.Close" "Test" -cmd {};
}

load_menu()

Regards

Can you help me?

David

Best answer by JeffStevenson

Hi David,

Here is a simple example for adding a menu after the Help menu in Editor.

An important note is to put your load scripts into the /init folder within your custom folders. Any scripts in this folder load when Editor opens. You also need to use a menuloadhook to load the menu function.

function initMenus(){

menu_add -menu .Help "MyMenu";

menu_add .MyMenu. "MyCommand" -cmd {myFunction()}

}

add_hook("menuloadhook","initMenus");

Hope that helps!

1 reply

1-Visitor
June 21, 2016

Hi David,

Here is a simple example for adding a menu after the Help menu in Editor.

An important note is to put your load scripts into the /init folder within your custom folders. Any scripts in this folder load when Editor opens. You also need to use a menuloadhook to load the menu function.

function initMenus(){

menu_add -menu .Help "MyMenu";

menu_add .MyMenu. "MyCommand" -cmd {myFunction()}

}

add_hook("menuloadhook","initMenus");

Hope that helps!

dgopois13-AquamarineAuthor
13-Aquamarine
June 21, 2016

Hi Jeff,

Thank you for your help.

David