www.skylinesoft.com Homepage
Forum Home Forum Home > SkylineGlobe Enterprise Products > TerraExplorer for Developers
  New Posts New Posts RSS Feed - Simple Object Creation
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Simple Object Creation

 Post Reply Post Reply
Author
Message
rickay View Drop Down
Skyline Customers
Skyline Customers


Joined: January 25 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote rickay Quote  Post ReplyReply Direct Link To This Post Topic: Simple Object Creation
    Posted: 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



Back to Top
rickay View Drop Down
Skyline Customers
Skyline Customers


Joined: January 25 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote rickay Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.109 seconds.