If you use an “On Premise / Cloud Installation”, our SDK is available to you. See section Server to Client Communication for further details on this topic.
The iframe sends some message events to its parent’s window object. To receive such events, you need to listen to JS ‘message’ events. Please note that this is not a Kudo specific mechanism but the native JavaScript message event is used so potentially you receive message events from other origin than Kudo iframe.
...
Code Block |
---|
{ messageName: "nameOfTheMessage", message: "{}" } |
Message Events
To avoid flooding parent with unnecessary messages, we have some type of message events you need to register for (Events you need to register for).
See Event register/Event deregister how to register or deregister for such message events.
Sent events
drawingLoaded
Sent when drawing is entirely loaded on clientside.
...
Code Block |
---|
{ "messageName" : "drawingLoaded" } |
connectionLost
Sent when the connection to the server is lost due to e.g. network issues or server-side session terminated unexpectedly.
...
Code Block |
---|
{ "messageName" : "connectionLost" } |
showChooseDialog
Sent by some commands (e.g. xref, insert, linetype) to open file chooser dialog.
...
id - file id of the selected file that is used to download the file (/files/:fileId/diffs)
folderId - id of the folder the selected file is in
name - file name (e.g. “test.dwg”)
path - file path absolute to root (e.g. “~/folderX/fileY.png”)
size - file size as a string (e.g. "11.9 kB")
creationDate - file creation date
updateDate - date of the last file update
google-analytics-data
When in the server configuration "send-ganalytics-to-parent" is true then we send google-analytics data to parent iframe instead of google-analytic server
We send data to parent Iframe like this
Code Block |
---|
{
"messageName":"google-analytics-data",
"hitType": string,
"components":string
} |
Where hitType is pageView and component is ‘/editor’
OR
Code Block |
---|
{
"messageName":"google-analyticsdata",
"hitType":string,
"eventCategory":string,
"eventAction":string,
"eventLabel":string
} |
Where hitType is an event and for other parameters, please check this
Events you need to register for
Command Events
Event name for registration: commandEvent
These events are fired when a command executes:
Message Name | Descriptions |
---|---|
commandWillStart | whenever the execution of a command will start. |
commandEnded | whenevever the execution of a command has ended |
commandCancelled | whenevever the execution of a command has been canceled. |
commandFailed | whenevever the execution of a command has failed. |
modelessOperationWillStart | whenever a modeless operation is about to start. |
modelessOperationEnded | whenever a modeless operation has ended. |
Structure of the Messages
commandWillStart
Code Block |
---|
{
"messageName": "commandEvent",
"message": "{"data": [ {"command name": string } ],
"eventType": "commandWillStart"}"
} |
commandEnded
Code Block |
---|
{
"messageName": "commandEvent",
"message": "{"data": [ {"command name": string } ],
"eventType": "commandEnded"}"
} |
commandCancelled
Code Block |
---|
{
"messageName": "commandEvent",
"message": "{"data": [ {"command name": string } ],
"eventType": "commandCancelled"}"
} |
commandFailed
Code Block |
---|
{
"messageName": "commandEvent",
"message": "{"data": [ {"command name": string } ],
"eventType": "commandFailed"}"
} |
modelessOperationWillStart
Code Block |
---|
{
"messageName": "commandEvent",
"message": "{"data": [ {"modeless operation": string } ],
"eventType": "modelessOperationWillStart"}"
} |
modelessOperationEnded
Code Block |
---|
{
"messageName": "commandEvent",
"message": "{"data": [ {"modeless operation": string } ],
"eventType": "modelessOperationEnded"}"
} |
Lisp Events
Event name for registration: lispEvent
These events are fired when a lisp action is performed:
Message Name | Descriptions |
---|---|
lispEnded | whenevever the execution of a lisp has ended |
lispCancelled | whenevever the execution of a lisp has cancelled |
Structure of the Messages
lispEnded
Code Block |
---|
{
"messageName": "lispEvent",
"message": "{"data": [ {"lisp called function": string } ],
"eventType": "lispEnded"}"
} |
lispCancelled
Code Block |
---|
{
"messageName": "lispEvent",
"message": "{"data": [ {"lisp called function": string } ],
"eventType": "lispCancelled"}"
} |
System Variables Events
Event name for registration: sysVarEvent
These events are fired when a system variable change action is performed:
Message Name | Descriptions |
---|---|
sysvarChanged | Occurs when a change is made to the value of a system variable. |
Structure of the Messages
sysvarChanged
Code Block |
---|
{
"messageName": "sysVarEvent",
"message": "{"data": [ {"System Variable": string } ],
"eventType": "sysVarChanged"}"
} |
Drawing Events
Event name for registration: drawingEvent
These events are fired when an action is performed on drawing:
Message Name | Descriptions |
---|---|
drawingSaved | when a drawing is saved. |
UploadBegin | when a drawing upload is going to start |
UploadComplete | when a drawing upload was done |
drawingDescription* | (*not implemented yet) |
Structure of the Messages
drawingSaved
Code Block |
---|
{
"messageName": "drawingEvent",
"message": "{
"eventType": "drawingSaved"
}"
} |
UploadBegin
Code Block |
---|
{
"messageName": "drawingEvent",
"message": "{
"eventType": "UploadBegin"
}"
} |
UploadComplete
Code Block |
---|
{
"messageName": "drawingEvent",
"message": "{"data": [ {"upload complete": bool} ],
"eventType": "UploadComplete"}"
} |
View Events
Event name for registration: viewChangedEvent
These events are fired when a view change action is performed:
Message Name | Descriptions |
---|---|
viewChanged | whenever the World to Eye transformation matrix has been changed. |
Structure of the Messages
viewChanged
Code Block |
---|
{
"messageName": "viewChangedEvent",
"message": "{"data": [ {"position": string,
"target": string,
"upVector": string,
"fieldWidth": string,
"fieldHeight":string
],
"eventType": "viewChanged"}"
} |
Selection Events
Event name for registration: selectionEvent
These events are fired when a selection action is performed:
Message Name | Descriptions |
---|---|
selectionChanged | when a change takes place to the current selection set. |
selectionCancelled | when a current selection is cancelled. |
Structure of the Messages
selectionChanged
Code Block |
---|
{ "messageName": "selectionEvent", "message": "{"data": [ {"selectionMethod": string, "numberOfEntities": string, "entity Properties": string, "entity Properties": string, "entity Properties": string ... } ], "eventType": "selectionChanged"}" } |
selectionCancelled
Code Block |
---|
{
"messageName": "selectionEvent",
"message": "{
"eventType": "selectionCancelled"}"
} |
Drawing Modified Events
Event name for registration: drawingModifiedEvent
These events are fired when a drawing edit action is performed:
Message Name | Descriptions |
---|---|
drawingModified | whenever any command or modeless operation is performed which could cause database modification. |
Structure of the Messages
drawingModified
Code Block |
---|
{
"messageName": "drawingModifiedEvent",
"message": "{"data": [
{"command name": string},
{"drawing should be saved":bool}
],
"eventType": "drawingModified"}"
} |