Versions Compared

Key

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

...

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

Code Block
var message = {

...


messageName: "runcommand",

...


commandString: "_YourCommand",

...


resultMessage: "nameOfPostedResultMessage", //optional

...


messageId: "messageId" ;//optional

...


}

...


window.postMessage(message, '*');

You can also pass parameters to your command like this:

Code Block

...

 commandString: "_YourCommand Param1 Param2"

or

Code Block

...

commandString: "_YourCommand\nParam1\nParam2"

resultMessage: if specified, message is posted to iframe parent when command execution is done

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:

where resultMessage: if specified, message is posted to iframe parent when lisp execution is done

and messageId: if specified, it is passed to resultMessage

Code Block
languagejs
var message = {

...


messageName: "runlisp",

...


lispExpression: "lispExpression",

...


resultMessage: "nameOfPostedResultMessage", //optional

...


messageId: "messageId"; //optional

...


}

...


window.postMessage(message, '*');

resultMessage: if specified, message is posted to iframe parent when lisp execution is done

messageId: if specified, it is passed to resultMessage

eventRegister
eventDeRegister

...

Event register:

Register for receiving different types of additional events . Available event types are:

commandEvent
lispEvent
sysVarEvent
drawingEvent
viewChangedEvent
selectionEvent
drawingModifiedEvent

notifications.

You can find available events on the event page. See https://graebert.atlassian.net/wiki/x/QAFdRg page for more details about events.

Register for the event:

where eventName will be the event Type which you want to register

Code Block
languagejs
var message = {

...


messageName: "eventRegister",

...


eventName: "commandEvent";//one of the above event types

...


}

...


window.postMessage(message, '*');

Even deregister:

Deregister to stop receiving different types of additional events notifications.

You can find available events on the event page. See https://graebert.atlassian.net/wiki/x/QAFdRg page for event:var message = {
    messageName: more details about events.

where eventName will be the event Type which you want to deregister

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

Downgrading: Change from Edit mode to view mode

}
You can update the drawing state using send post message from iframe parent

where state can be “view” Or “edit”

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