Rik's Treehouse > Babbling in Binary > My Software > Orphanware > R2DToo > R2DToo Help > Automation > LoadModel

LoadModel

Declaration
Parameters
Return Value
Remarks
Revisions
Example
See Also

Declaration

object.LoadModel(model)
Top of page

Parameters

object
Required. Always the name of a R2DToo.FrontEnd object.
model
Required. The location of a model.dll file.
Top of page

Return Value

Returns 1 if the model was successfully loaded, else 0. Top of page

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.

Top of page

Revisions

v1.8
  • new!
Top of page

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 ... Top of page

See Also

GetLoadModelErr.
Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:47pm