www.skylinesoft.com Homepage
Forum Home Forum Home > SkylineGlobe Enterprise Products > TerraExplorer for Developers
  New Posts New Posts RSS Feed - How to use "IScriptEngine5" ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to use "IScriptEngine5" ?

 Post Reply Post Reply
Author
Message
alspdishla View Drop Down
Visitor
Visitor


Joined: January 14 2010
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote alspdishla Quote  Post ReplyReply Direct Link To This Post Topic: How to use "IScriptEngine5" ?
    Posted: January 14 2010 at 11:11pm
when I use "IScriptEngine5" in the way as the following codes show,the function of the script is exuted.But I can't  do anything with the mouse in the 3D window.If I do,the 3D window will Unloading terrra and my application will  quit abnormal.
 
private void button1_Click(object sender, EventArgs e)
        {
           
            string readText = File.ReadAllText("script.txt");
            IScriptEngine.RegisterGlobalName("TE", TE, 0);
            IScriptEngine.Run(readText);
                       
        }
 
the contents of "readText" are follows:
 
    Set ITerraExplorer = TE.interface("ITerraExplorer5")  
    Set IRender = TE.interface("IRender5")  
    Set IObjectManager = TE.interface("IObjectManager5")  
    Set IInformationTree = TE.interface("IInformationTree5")  
    Set IPlane = TE.interface("IPlane5")  
    Set IContainer = TE.interface("IContainer2")      
    Set ICoordSys  = TE.interface("ICoordSys3")  
    Set ITerrain   = TE.interface("ITerrain4")  
   
    ItemID=IInformationTree.FindItem("poly")   
    Set ITerraExplorerObject = nothing  
    Set ITerraExplorerObject = IInformationTree.getObject(ItemID)  
    IPlane.FlyToObject IterraExplorerObject.id,0  
    IObjectManager.CreateSphere 120,23,10,1000,0,30,33,66,00646464,0,0,"asd"
Back to Top
Eylon View Drop Down
Skyline Admin Group
Skyline Admin Group
Avatar

Joined: May 05 2003
Location: Israel
Status: Offline
Points: 263
Post Options Post Options   Thanks (0) Thanks(0)   Quote Eylon Quote  Post ReplyReply Direct Link To This Post Posted: March 04 2010 at 5:56pm
alspdishla,
It works like a charm when I try, here is my complete code, maybe you can look for the differnece:
 

namespace WindowsApplication47
{
public partial class Form1 : Form
{
private TerraExplorerClass TE;
private IScriptEngine5 IScriptEngine;
 
public Form1()
{
InitializeComponent();
this.TE = new TerraExplorerClass();
this.IScriptEngine = (IScriptEngine5)this.TE;
}
private void button1_Click(object sender, EventArgs e)
{
string readText = System.IO.File.ReadAllText(@"C:\TEMP\0403\script.txt");
this.IScriptEngine.RegisterGlobalName("TE", this.TE, 0);
this.IScriptEngine.Run(readText);
}
}
 
If it doesn't help consider uploading a full sample that forum users can help you with.
Best,
Eylon
Eylon
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.047 seconds.