Example of a JScript
# h9 t- X' M# ^1 Tvar vbOKCancel = 1;
' F* X `- Y+ e4 {- Nvar vbCancel = 2; . B. U1 d) b1 A1 X& `( F
var vbInformation = 64; 4 Q$ K& ?- a/ e; R
var Finished=false; . U1 w5 M/ j& n% o* a. i
. z4 V9 S( r4 j( ^var WSHShell = new ActiveXObject("WScript.Shell");
/ G8 C. r! f* ~. S- x8 m( u( B
) F2 P# o. y1 P7 q' r& ?* G \% dvar simple = WScript.CreateObject("Tecnomatix.PlantSimulation.RemoteControl.9", "RemoteControl_"); ! h5 U1 F; t3 t8 E" ]1 d) j
: X+ z& Y" i$ j3 L: x" r/ }/ P
simple.SetLicenseType("Runtime");
) n9 F& e; y d . X2 ?7 Q: x% V$ c( W5 y
try ; e" A, @+ H. X: o
{ 2 W' r4 U7 u7 C: t
// Enter the path to a model file! # _$ A3 A+ Y: o; S! I7 m$ |' t4 d
simple.LoadModel("C:\\Models\\Test.spp"); ) O+ |, M8 n# J) y
} ~* I/ C c$ S0 n# e: _8 m) S/ Q3 [
catch (e) ( @9 r1 _/ U `
{ - e5 S$ [1 Y! \+ I7 l( g
WScript.Echo("Could not load Model!"); + n$ u* N" d: p0 m+ K
WScript.Quit(); : J4 Y) K6 R; l. ~
} % Q# u# U# U' X6 M7 ~
# k* U1 H8 }* wtry
: F G" F+ d1 b9 t{
+ K! ~! l. I$ F/ B' E simple.SetValue(".Models.Frame.Buffer.procTime", 700.0); } catch (e) { & Z1 d1 t5 t# G
r=WSHShell.Popup(e.description, 0, "Continue?", vbOKCancel + vbInformation);
! Q8 L" n8 L7 i( ` if (r == vbCancel)
/ o) C) _: P: |. ^; | {
9 }2 o: Q; G+ g: H5 n simple.CloseModel();
p6 [* U+ J* n, K8 ] WScript.Quit();
& m2 x! Q) M" r) K. q }
; p* l7 {. O+ B7 Z4 ~} $ b9 \' ?6 h/ m: m
2 T" U0 t' B) F% x
simple.StartSimulation(".Models.Frame.EventController"); 6 d C4 [% T. o2 x8 d" E5 p
# M: ]1 y/ T, l; |if (simple.IsSimulationRunning()) - [6 ?: B6 X- j8 H4 a
WScript.Echo("Simulation is running!"); 0 X) Y$ O% h! J1 Y( ]0 Q
% h/ l9 E; A1 C8 m5 T// Wait until simulation is finished
& z. r! m$ Z7 T1 M8 r( ^; |while (!Finished) WScript.Sleep(2000);
9 \) H& K9 _' I) W. y. ]3 ^ 1 l! A# S% T4 L( c5 T
simple.CloseModel(); ' d* H, e8 e1 p5 Z+ c3 A
simple.Quit(); ; `. [2 h# s2 d, z
WScript.Quit();
4 l- w. y: |- u* ?" l$ _ 5 |% a' e% _; ]6 D2 F; k' b
& Y& {8 l( W- \) }function RemoteControl_SimulationFinished() 0 Q, J1 p5 r) {9 y% T
{ ) a2 e9 ~+ V3 c' d- T$ u" J
WScript.Echo("Simulation Finished!"); |