Hi,
we generate python code that the user can access in the python editor. For example here 'MyStructList' is a generated type, where the method 'copy' returns a list which contains a copy of the elements. However if we want to access the members, the intelli prompt is empty:
from sys_pars import MyStructList
def IntFieldAccess():
for testVector in MyStructList.copy():
print(testVector.IntField)
I have tried many different ways to access the members, with or without type hints, but none of them are working. I am also attached to the UnknownReturnTypeReferenceCallback event, but the event args only contain the name of the variable. Not even the module or offset are set. Therefore I see no way to resolve the type myself.
The generated code looks like this:
import RTPython39
from typing import Iterator, Union
class _0_MyStructList_type:
def __init__(self, name):
self._qualified_name = name
class _0_MyStructList_element_type:
def __init__(self, index: int):
self._index = index
@property
def IntField(self) -> int:
return RTPython39.get_list_parameter_value_int64("MyStructList.IntField", self._index)
def copy(self) -> list[_0_MyStructList_element_type]:
length = RTPython39.get_struct_list_parameter_length(self._qualified_name)
return [_0_MyStructList_type._0_MyStructList_element_type(i) for i in range(length)]
MyStructList = _0_MyStructList_type("MyStructList")
Best regards, Tobias Lingemann.