Python4Capella - get_value() error with boolean property values

Hi,

I’ve come across a bizarre bug with the use of python4capella.
I’m writing a script which exports the property values and some information about them into an xlsx file.

One of the pieces of information I need from each property value is the ‘Value’.
The simplified_api capella.py clearly shows the function ‘get_value’ exists and the function seems to work fine when called in my script.

BUT

The problem arises when the property value is a boolean type. The function get_value, when called, no longer works and the script fails to run with the error stating:

‘py4j.protocol.Py4JError: An error occurred while calling o34399.getValue. Trace:
py4j.Py4JException: Method getValue([]) does not exist’

Any advice or help to resolve this would be great,

Many thanks,
Angus

Hi,

Indeed on BooleanPropertyValues you must use isValue() to get the value.
Please refer to the simplified_api/pvmt.py for additional information on the Property Value API.

Regards,
Arnaud

1 Like