Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

Runtime::Command

  • Last UpdatedApr 24, 2024
  • 2 minute read

The Runtime::Command class allows to use most of the command nodes that already exist in the XRS scripting language.

Code example

These examples demonstrate how command node fields are passed as named parameters to the method following the syntax: nodeFieldName:”fieldValue”

Runtime::Command.set(name:"testVar.value", value:"myvalue", resolve:"true");

Runtime::Command.createnode(name:"CAM_TRIAL", nodeType:"Camera");

It is possible to add multiple comma-separated parameters and each call should have exactly what would be needed in the XML counterpart. Parameters are always passed as strings and automatically resolved by the XML string resolver, exactly as they would be resolved in an XML command statement.

Commands

The following table shows the commands currently accessible as static methods from Runtime::Command class.

Command nodes supported 

Description 

addcontext 

Adds a context to a currently active context list. 

binarytotexture 

Updates the content of a Texture2D node by using the binary data stored inside an sbinary field. 

changecontext 

Moves from the current context to another context. 

copy 

Assigns value to any node field or local variable from another field or local variable. 

createnode 

Creates an instance of most of the node types at runtime. 

createroute 

Creates a route between two fields at runtime. 

createshare 

Instantly shares a field value to the message bus at runtime.  

debug 

Logs information on the screen, allowing to check the execution of certain operations. 

delcontext 

Removes a context from currently active context list. 

deletenode 

Deletes a node instance, both loading defined and runtime instantiated. 

deleteshare 

Instantly deletes an existing share on the message bus. 

delroute 

Removes all the previously defined routes that were created between the from and to values at runtime.  

execute 

Enables to trigger the execution of a command or a coroutine.

exit 

Closes the application from the inside. 

log 

Adds a line to the log file from script and can be used for debugging purposes. 

meshchangetexture 

Causes a mesh to replace one of its textures. 

modify 

Performs an operation on a node field or local variable.  

readfield 

Populates a field (usually an mstring, dstring or an sjson) from a text file. 

set 

Assigns an arbitrary value to any node field or local variable. 

setalias 

Assigns a different node to an Alias

setrenderpriority 

Change the rendering priority of an object, such as mesh, sky, human, particles. 

texturetobinary 

Stores the content of a Texture2D node instance inside an sbinary field. 

writefield 

Writes a field (usually an mstring, dstring or an sjson) into a text file. 

writefile 

Exports formatted data from the application. It supports a simple template file tagging language and allows to copy binary files without applying tag processing. 

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in