Introduction
Introduction
JavaScript is a freely available scripting language that is normally found performing the "work" behind interactive web pages, however its syntax and structure also make it an excellent tool for providing an externally programmable interface to programmes in general.
Within D3PLOT it is implemented as follows:
-
There is a D3PLOT Application Programming Interface (API) within the JavaScript API Reference Manual which provides
a range of functions that allow you to interrogate the database, open windows,
generate plots, and so on. This is written in a very simple and non-intimidating
way, with relatively few functions, that should be easy for non-programmers
to use.
-
There is also a function which issues "command line" instructions
to D3PLOT, making it possible to use the code's full repertoire of command-line
commands, meaning that virtually every function in D3PLOT is callable from
within a JavaScript.
- There is a special class of "user defined binary (UBIN) data components" that can be created from within a JavaScript, making it possible to generate an unlimited number of new data components which then become available for processing in exactly the same way as the standard ones found in an Ansys LS-DYNA database.
Anyone familiar with C or shell script programming will find existing JavaScripts are instantly readable, and can be given minor edits without further ado. For those who are more ambitious a good guide to the language is " JavaScript, A definitive Guide " by David Flanagan, published by O'Reilly, ISBN 0596101996.
In D3PLOT 17.0 and earlier the implementation supported ECMAScript 5 features of JavaScript. In D3PLOT 18.0 the implementation has been upgraded to support ECMAScript 6 (and newer) features of JavaScript.
The sections below describe how to run JavaScripts in D3PLOT, and summarise the JavaScript API. For details of the API and its functions, and also some examples, see the JavaScript API Reference Manual