![]() |
Simple Object Creation |
Post Reply
|
| Author | |
rickay
Skyline Customers
Joined: January 25 2006 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: Simple Object CreationPosted: January 26 2006 at 12:09pm |
|
I'm just beginning to code with TerraDeveloper within a Visual Basic environment. I have been able to load a .fly that I'm storing locally. However, now I want to create objects (using IObjectManager4) to overlay on top of the .fly terrain. I have made a separate command button to test the functionality of loading a polyline (as in the example in the TerraExplorer help file). However, I have not been able to get the polyline to appear at the correct coordinates..it simply flies to creates a "null" polyline at (0,0). Any help with the following code would be greatly appreciated!
Dim WithEvents TE As TerraExplorer Private Sub Command1_Click() Set TE = CreateObject("TerraExplorer2.TerraExplorer") TE.Load ("F:\Iraq\Iraq.fly") End Sub Function CreateVertArray() Dim vert(9) vert(0) = 44.417399 'First vertex X-coordinate. vert(1) = 440 &nb sp; 'First vertex height. vert(2) = 35.410076 'First vertex Y-coordinate. vert(3) = 44.417422 'Second vertex X-coordinate. vert(4) = 460 &nb sp; 'Second vertex height. vert(5) = 35.411099 'Second vertex Y-coordinate. vert(6) = 44.417445 'Third vertex X-coordinate. vert(7) = 460 &nb sp; 'Third vertex height. vert(8) = 35.412158 'Third vertex Y-coordinate. CreateVertArray = vert End Function Private Sub LoadLineCmd_Click() Dim IObMan4 As IObjectManager4 Set IObMan4 = TE IObMan4.CreatePolyline CreateVertArray, 44703, 0 End Sub |
|
![]() |
|
rickay
Skyline Customers
Joined: January 25 2006 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: January 30 2006 at 8:17am |
|
Answered my own question:
I was creating an array of single precision numbers and integers...which VB does not like of course. Changed the array to the following and it worked fine. Dim vert(9) vert(0) = 44.417399 'First vertex X-coordinate. vert(1) = 440.01 'First vertex height. vert(2) = 35.410076 'First vertex Y-coordinate. vert(3) = 44.417422 'Second vertex X-coordinate. vert(4) = 460.01 'Second vertex height. vert(5) = 35.411099 'Second vertex Y-coordinate. vert(6) = 44.417445 'Third vertex X-coordinate. vert(7) = 460.01 'Third vertex height. vert(8) = 35.412158 'Third vertex Y-coordinate. |
|
![]() |
|
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 |