This is what I have envisioned and I'm apparently not correct because the SIMCONNECT_DATA_INITPOSITION is private and cannot be set in this fashion. What am I missing here..?
Dim init_truck As SIMCONNECT_DATA_INITPOSITION
With init_truck
init_truck.altitude = 8
init_truck.latitude = 35.77
init_truck.longitude = -84.76
init_truck.pitch = -0.0
init_truck.bank = -1.0
init_truck.heading = 180.0
init_truck.onground = 1
init_truck.airspeed = 0
End With
fsx_simconnect.AICreateSimulatedObject("VEH_jetTruck", init_truck, DATA_REQUESTS.TRUCK)
I'm not so sure this isn't a lesson about VB.NET or SimConnect. This is simple, or should be. I'm just trying to create a simple truck. A similar C-based example is as follows (only for aircraft).
{
SIMCONNECT_DATA_INITPOSITION Init;
HRESULT hr;
// Add a parked museum aircraft, just west of the runway
Init.Altitude = 433.0; // Altitude of Sea-tac is 433 feet
Init.Latitude = 47 + (25.97/60); // Convert from 47 25.97 N
Init.Longitude = -122 - (18.51/60); // Convert from 122 18.51 W
Init.Pitch = 0.0;
Init.Bank = 0.0;
Init.Heading = 90.0;
Init.OnGround = 1;
Init.Airspeed = 0;
hr = SimConnect_AICreateSimulatedObject(hSimConnect, "Douglas DC-3", Init, REQUEST_DOUGLAS);
See how they can set the SIMCONNECT_DATA_INITPOSITION so easily? Why does VB.NET turn this into a nightmare..? I must be missing something so basic (in Visual Basic) that, well, it can't be good.
Any much needed light you could shed on this issue would be greatly appreciated.
Thanks Guys.
Dim init_truck As SIMCONNECT_DATA_INITPOSITION
With init_truck
init_truck.altitude = 8
init_truck.latitude = 35.77
init_truck.longitude = -84.76
init_truck.pitch = -0.0
init_truck.bank = -1.0
init_truck.heading = 180.0
init_truck.onground = 1
init_truck.airspeed = 0
End With
fsx_simconnect.AICreateSimulatedObject("VEH_jetTruck", init_truck, DATA_REQUESTS.TRUCK)
I'm not so sure this isn't a lesson about VB.NET or SimConnect. This is simple, or should be. I'm just trying to create a simple truck. A similar C-based example is as follows (only for aircraft).
{
SIMCONNECT_DATA_INITPOSITION Init;
HRESULT hr;
// Add a parked museum aircraft, just west of the runway
Init.Altitude = 433.0; // Altitude of Sea-tac is 433 feet
Init.Latitude = 47 + (25.97/60); // Convert from 47 25.97 N
Init.Longitude = -122 - (18.51/60); // Convert from 122 18.51 W
Init.Pitch = 0.0;
Init.Bank = 0.0;
Init.Heading = 90.0;
Init.OnGround = 1;
Init.Airspeed = 0;
hr = SimConnect_AICreateSimulatedObject(hSimConnect, "Douglas DC-3", Init, REQUEST_DOUGLAS);
See how they can set the SIMCONNECT_DATA_INITPOSITION so easily? Why does VB.NET turn this into a nightmare..? I must be missing something so basic (in Visual Basic) that, well, it can't be good.
Any much needed light you could shed on this issue would be greatly appreciated.
Thanks Guys.