How to set type for ExchangeItemElement

Hello Python4Capella
I need to set ExchangeItemElement type as a set of self-defined Numeric Type, such as int8/float64. These numeric types are defined in a “DataType” capella library and referenced in this project.
Now P4C provides get_type(). Is there any way to set_type for ExchangeItemElement? If needed, we could duplicate those data types into this project if the DataType library gets in the way.

You need to set the abstract type:

myDataType = ...
myExchangeItemElement.setAbstractType(myDataType.get_java_object())

Thanks. It makes sense.
I am trying to get numeric type under a reference library
for lib in model.get_referenced_libraries():

File “workspace://Python4Capella/WIP.py”, line 48, in
# Python 3.*
File “workspace://Python4Capella/simplified_api/capella.py”, line 55, in get_referenced_libraries
def _pyease_patch_builtins(name, value):
File “workspace://Python4Capella/java_api/Capella_API.py”, line 60, in get_libraries
:param name: Name of the builtin
File “workspace://Python4Capella/simplified_api/capella.py”, line 78, in open
string_types=_pyease_string_types,
NameError: name ‘unicode’ is not defined

The unicode type is a Python 2.x type, it has been replaced by the str type in Pyhton 3.x. You can remove this part of the test in capella.py line 78. At some point I should remove it.