JS API pfcUICommand.Designate
Hello, i've been tryign ot designate created command in PTC Creo JS API and didn't succed at all.
Creo API can't find message file. I've been also trying to create absolute path to message file but it didn't work too.
Here is my code example:
// 1) Get the active Creo session
var session = pfcGetCurrentSession();
// 2) Unique id for your command (make it unique per run while testing)
var COMMAND_NAME = "MyJsSampleCommand_" + (new Date().getTime());
// 3) Implement the action listener
var actionListener = pfcUICommandActionListener.create({
OnCommand: function (commandId) {
print("Hello from " + COMMAND_NAME + "!");
},
OnCommandEnable: function (commandId) {
return pfcCommandStatus.pfcCommandStatus_Enabled;
}
});
// 4) Create the UI command
var uiCmd = session.UICreateCommand(COMMAND_NAME, actionListener);
// 5) Designate it so it can be placed in Screen Customization
uiCmd.Designate(
"message.txt", // Message file
"MyCmdLabel", // Label key from ui_message.txt
"MyCmdHelp", // Help key (or null)
"MyCmdDesc" // Description key (or null)
);
// 6) (Optional) Assign an icon
// uiCmd.SetIcon("my_cmd_icon.gif");
Screenshot from support.ptc.com no directory described:

screenshot from pdf no directory described:

There is also no format and description about how does this file has to look like.
Here is how it looks like when i run it via DevTools


