Autodesk Creative Platform Runtime Library Version 1.5.0
Implicit Capabilities and Client-Side Runtime

Environment Overview

The Runtime's Environment is where variables can be configured that affect the execution of Libraries that have been loaded. The runtime is accessible on the client via the Runtime using Runtime.environment. A partial listing of some of the variables that are in use today are described in greater depth below.

  1. 'callbacks'
    • 'panic' : Function ( String ) - A callback function that can be configured to handle panic notifications from Plugin.panic statements.
  2. 'disconnected'
    • 'enabled' : Boolean - True if the libraries are running disconnected from https://api.tinkercad.com, which happens when a disconnected version is downloaded and run offline, otherwise False.
  3. 'host'
    • 'elementId' : String - The ID of the HTMLElement where the runtime can display error messages.
  4. 'outcomes'
    • 'logs' : Array [ String , ... ] - An array of diagnostic log statements collected from Debug.log statements in client code.
    • 'warnings' : Array [ String , ... ] - An array of diagnostic warnings collected from Debug.warning statements in client code.
    • 'points' : Array [ Array [ Number , ... ] , ... ] - An array of arrays, containing diagnostic points collected from Debug.point statements in client code.
    • 'lines' : Array [ Array [ Number , ... ] , ... - An array of arrays, containing diagnostic lines collected from Debug.line statements in client code.
  5. 'parameters' : Configuration information for parameters
  6. 'process'
    • 'id' : String - An identifier for the process that the code is running in.
  7. 'proxies'
    • 'shapeGenerator' : Function ( Object ) - A function that instantiates a Proxy object for the object returned from a client's shapeGenerator export.
    • 'shapeConfigurator' : Function ( Object ) - A function that instantiates a Proxy object for the object returned from a client's shapeConfigurator export.
    • 'shapeModifier' : Function ( Object ) - A function that instantiates a Proxy object for the object returned from a client's shapeModifier export.
  8. 'resources'
    • 'root' : String - A root path that can be altered to indicate where the resources are when running in disconnected mode.
    • 'map' : Object [ String , String ] - When a disconnected version is deployed to a CDN, the resources may get different URLs altogether so this allows the original resource names to be configured to the new locations.
    • 'minified' : Boolean - Indicates whether minified resources should be used. The default is True if unspecified, otherwise False can be configured.
  9. 'urls'


Introduced in Version: 1.0.0

Static Member Summary

Static Member Details

Object or undefined getVariable (keys, [defaultValue])

Gets a previously defined variable given a location.
  • keys: Array [ String , ... ] - An array of string identifiers indicating where the variable is stored at.
  • defaultValue: Object - If there is currently no value set, this default value is set then returned. | Optional

2 Examples:

var host = env.getVariable(['urls', 'api']);
var someCustomVariableValue = env.getVariable(['somenamespace', 'someotherkey', 'somevariablename']);

• setVariable (keys, value)

Sets a variable given a location. The implementation ultimately builds up an object so it's possible to erase multiple things based on structure.
  • keys: Array [ String , ... ] - An array of string identifiers indicating where the variable is stored at.
  • value: Object - Any value to set. If the value is undefined, it removes the last altogether.

2 Examples:

env.setVariable(['urls', 'api'], 'https://api.tinkercad.com');
env.setVariable(['somenamespace', 'someotherkey', 'somevariablename'], 'Variable Value');