從 URL 載入 javascript 檔案,然後執行包含在檔案中的 JavaScript 碼。
提示您輸入 URL 和 JavaScript 檔案的名稱。例如:
Command: WEBLOAD Enter name of URL to load: https://website/filename.js
JavaScript 檔案必須包含函數定義和下列簡單範例所示的函數呼叫。
// Function definition function pickPoint() { function onComplete(arg) { var resObj = arg; if (resObj) alert('You picked: ' + resObj.value.x + "," + resObj.value.y + "," + resObj.value.z); } function onError(arg) { alert('Error picking point: ' + arg); } 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();