![]() |
How to use "IScriptEngine5" ? |
Post Reply
|
| Author | |
alspdishla
Visitor
Joined: January 14 2010 Status: Offline Points: 1 |
Post Options
Thanks(0)
Quote Reply
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" |
|
![]() |
|
Eylon
Skyline Admin Group
Joined: May 05 2003 Location: Israel Status: Offline Points: 263 |
Post Options
Thanks(0)
Quote Reply
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:
If it doesn't help consider uploading a full sample that forum users can help you with.
Best,
Eylon
|
|
|
Eylon
|
|
![]() |
|
Post Reply
|
|
|
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |