Loads a JavaScript file from a URL, and then executes the JavaScript code contained in the file.
Prompts you to enter the name of a URL and JavaScript file. For example
Command: WEBLOAD Enter name of URL to load: http://website/filename.js
The JavaScript file must contain a function definition and an invocation of the function as shown in the simple example below.
// Function definition
function pickPoint() {
function onComplete(args) {
var resObj = JSON.parse(args);
if (resObj)
alert('You picked: ' + resObj.value.x + "," + resObj.value.y + "," + resObj.value.z);
}
function onError(args) {
alert('Error picking point: ' + args);
}
var optionsFirst = new Acad.PromptPointOptions('Pick a point', new Acad.Point3d(0, 0, 0));
Acad.Editor.getPoint(optionsFirst).then(onComplete, onError);
}
//Invocation of function
pickPoint();