Hello !
I am using the get_all_contents_by_type(LogicalComponent) function in the following script:
model = CapellaModel()
model.open(aird_path)
se = model.get_system_engineering()
NLC = len(se.get_all_contents_by_type(LogicalComponent))
This script is working properly on different project on Capella 6.0. I tried it on a project on Capella 5.2 and had the following issue :
org.eclipse.ease.ScriptExecutionException: Traceback (most recent call last):
File “workspace://Python4Capella/sample_scripts/2_Composant_possede_une_fonction.py”, line 28, in
from py4j.java_collections import SetConverter as _pyease_SetConverter
File “workspace://Python4Capella/simplified_api/capella.py”, line 239, in get_all_contents_by_type
self.except_data = except_data
File “workspace://Python4Capella/java_api/Java_API.py”, line 35, in next
try:
File “workspace://Python4Capella/java_api/Java_API.py”, line 27, in next
from py4j.java_collections import ListConverter as _pyease_ListConverter
File “workspace://Python4Capella/simplified_api/capella.py”, line 164, in get_class
‘’’
AttributeError: module ‘main’ has no attribute ‘Attribute’
Does somebody know why I get this issue? Is it due to Capella 5.2?