Declaration Parameters Return Value Remarks Revisions Example See Also
| Declarationobject.LoadModel(model)

Parameters
- object
- Required. Always the name of a R2DToo.FrontEnd object.
- model
- Required. The location of a model.dll file.

Return Value
Returns 1 if the model was successfully loaded, else 0.

Remarks
Use this function to load a specific model into R2DToo. The string model may contain a relative or absolute path or none at all.
When R2DToo starts it automatically tries to load the file model.dll in the current directory. Unfortunately, when automated under MS-Windows 2000 (and XP?) the call Wscript.CreateObject("R2DToo.FrontEnd") sets the current directory to C:\WINNT\system32 (or something similar) for the newly created object, leading to unpredictable results. To ensure the correct model is loaded, you should always manually call LoadModel with the full path to the desired model.

Revisions
v1.8

Example' [VBScript]
Dim R2DToo
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo "Loading R2DToo..."
Set R2DToo = Wscript.CreateObject("R2DToo.FrontEnd")
WScript.Echo "Loading model Conway's Life..."
If R2DToo.LoadModel(WshShell.CurrentDirectory & "\..\Models\ConwaysLife\model.dll") Then
WScript.Echo "R2DToo loaded with model: " & R2DToo.AboutModel("Name") & " " & R2DToo.AboutModel("Version")
Else
Wscript.Echo R2DToo.GetLoadModelErr()
Set R2DToo = nothing
Wscript.Quit(1)
End If
...

See Also
GetLoadModelErr.
|