Example of a JScript e: r7 u1 t* X/ g0 [# S7 \: X
var vbOKCancel = 1; 6 }- @3 E4 E- w2 X& O# o" L
var vbCancel = 2;
' r& T1 Y# m* ^2 d+ @; evar vbInformation = 64;
/ \; Y# Q. c5 z. X4 O; X7 Fvar Finished=false;
/ G" ~# {+ A# G* n0 U0 X & Y |5 [0 B& v, b) u9 x
var WSHShell = new ActiveXObject("WScript.Shell");
" e4 R8 C6 ^# `* c" L9 Z# \8 T7 H' d
: u7 D& `. v4 W" l0 ]. |var simple = WScript.CreateObject("Tecnomatix.PlantSimulation.RemoteControl.9", "RemoteControl_");
% m5 H8 c1 O8 K \0 Y( s & O h/ S; W6 Q- p- m6 ?
simple.SetLicenseType("Runtime"); * |' c: g5 x* _" a% o) t. n5 T
y' ?: c. T" o- P9 S7 Ztry
* o, Y0 `: V8 [8 Z D, o% y{
6 `4 }( R* x5 t R: l // Enter the path to a model file!
7 x( K" e3 W6 Y U" v, \- x simple.LoadModel("C:\\Models\\Test.spp");
' a8 K3 Q, _2 P" p} " H9 a7 O. a; F( \/ z
catch (e)
. L O* Y( o+ ~; O' W# a& i* |0 x9 F{
- z5 V4 a4 A( m: M+ ^& ` WScript.Echo("Could not load Model!"); 4 D0 @& X8 r0 V v2 J+ k+ U
WScript.Quit();
0 g5 K: K' Z0 S) p# }# ^8 [$ f5 G6 [} # d9 Z7 u% A& i; S0 U/ z
4 }+ k/ `9 e8 j- _+ Z0 l6 T
try ; g% ^0 g- R) I) X) E' I
{
( X4 g% a: N9 {6 [; ~ simple.SetValue(".Models.Frame.Buffer.procTime", 700.0); } catch (e) {
; S1 j- ?: I2 f7 K' d( _ r=WSHShell.Popup(e.description, 0, "Continue?", vbOKCancel + vbInformation);
/ b, ~9 A; p9 |6 t: a/ n/ Y if (r == vbCancel)
! u1 j4 d0 a4 P: S { 7 D: A6 q1 g( x6 T: w' m9 p% S
simple.CloseModel();
2 h3 \. X9 z. }1 j% }+ _ WScript.Quit(); . i' X$ p0 L5 d' s9 G) @
} % A) `$ D% t4 [
} * w/ K; r& R9 C) _5 H
5 b! N% d0 ^" u H5 Asimple.StartSimulation(".Models.Frame.EventController");
" `# B. R9 b. ^
1 @' \. _/ P# H; y+ u$ u1 Q! ?if (simple.IsSimulationRunning())
7 F" g8 Y: W4 [/ @( |$ X WScript.Echo("Simulation is running!");
% O4 ?. V! y8 e% M
1 |) x# _. H1 t1 _* M: X" y# S: O// Wait until simulation is finished
1 @$ Y" e) D" |3 J; p! e8 zwhile (!Finished) WScript.Sleep(2000); / A9 q. a4 T# M) r' R5 z% C1 W! f
& p7 t6 q# N5 J9 }simple.CloseModel();
* Q/ ^6 g: ?" S8 l3 Q) Msimple.Quit();
+ W4 z1 y2 m$ y9 P! L. [+ aWScript.Quit(); % j) D/ |; [+ X+ J) P7 t, K1 @# E& I
8 i% d8 T2 w7 ]4 n' N% S
8 h2 ~( Y& B& Hfunction RemoteControl_SimulationFinished()
% r4 r- ^! F# @" k6 o( T{ 4 P3 g; T! f! Y3 m1 Z
WScript.Echo("Simulation Finished!"); |