Python-SimConnect icon indicating copy to clipboard operation
Python-SimConnect copied to clipboard

Cannot spawn new aircraft

Open fyyyyy opened this issue 3 years ago • 2 comments

I figured out how to call the method without errors ( already corrected the AICreateNonATCAircraft args types as in issue #112 ) This script runs fine, but the aircraft doesn't seem to appear in MSFS at Lat 40,Lng-74

from SimConnect import *
from ctypes import *
sm = SimConnect()
aq = AircraftRequests(sm, _time=3)
ae = AircraftEvents(sm)


# get class definition for SIMCONNECT_DATA_INITPOSITION
sm_types = sm.dll.AICreateNonATCAircraft.__ctypes_from_outparam__()
INIT_POSITION = sm_types.argtypes[3]

initPos = INIT_POSITION(c_double(40), c_double(-74), c_double(2000), c_double(0), c_double(0), c_double(0), DWORD(0), DWORD(-1))

sm.dll.AICreateNonATCAircraft( sm.hSimConnect, c_char_p(b"Boeing 747-8f Asobo"), c_char_p(b"ABCD"), initPos, 123 )

fyyyyy avatar Jan 11 '22 12:01 fyyyyy

Hi, can someone explain if this is posible? I test the code but I obtain an error

bolichin avatar May 15 '24 16:05 bolichin