Opening a Project

This sample demonstrates event handling in the context of opening a project. It shows how to set the parameters for opening the project, retrieve a project interface and then open the project. This example uses the IProject61 (Open) IApplication61 (ExecutablePath) and SGWorld (OnLoadFinished) interfaces.

 

function LoadFly()

        {

            var flyPath = "C:\\Projects\\TE61CodeSamples\\Resources\\FlyFiles\\simplefly.fly";

 

            // C. Register to OnLoadFinished globe event

            sgworld.AttachEvent("OnLoadFinished", OnProjectLoadFinished);

            // default load is in async mode

            sgworld.Project.Open(flyPath);

            alert("Opening project " + flyPath + " in async mode");

        }

 

        function OnProjectLoadFinished()

        {

            alert("Recieved project loaded event");

        }