Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Message data sent to iframe is expected to be a JSON object with a messageName string and some message depenent strings.

Code Block
{
  messageName: "nameOfTheMessage",
  ...
}

Supported messages

runcommand

Run a command in Kudo:

where resultMessage: if specified, the message is posted to the iframe parent when command execution is done and messageId: if specified, it is passed to resultMessage

...

Info

Note: Only whitelisted commands are allowed to be run from the client side by runcommand message. To whitelist a command, add it to Default Files\OEM Commands\commands.xml

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<commands>
 <OEM name="graebert">
   <command name="_XEREPLACEOPEN"/>
   <command name="_DOATTACHMENT"/>
   <command name=" _YourCommand"/>
 </OEM>
</commands>

runlisp

Execute the passed Lisp expression:

...

Code Block
languagejs
var message = {
messageName: "runlisp",
lispExpression: "lispExpression",
resultMessage: "nameOfPostedResultMessage", //optional
messageId: "messageId"; //optional
}
window.postMessage(message, '*');

Event register

...

Register for receiving different types of additional events notifications.

...

Code Block
languagejs
var message = {
messageName: "eventRegister",
eventName: "commandEvent";//one of the above event types
}
window.postMessage(message, '*');

Event deregister

...

Deregister to stop receiving different types of additional events notifications.

...

Code Block
languagejs
var message = {
messageName: "eventDeRegister",
eventName: "commandEvent";//one of the above event types
}
window.postMessage(message, '*');

Upgrading/Downgrading

Upgrading: To change from View mode to Edit mode

...

Code Block
languagejs
var message={
messageName= “stateChanged”,
state = “view”;
}
window.postMessage(message, '*');

setvariable **

Info

Change a variable value

drawingdescription**

Info

Trigger creation of drawing description

** Not implemented yet