Closed ylussaud closed 11 months ago
Hi @ylussaud
I tried to substitute the body of the get_all_diagrams()
method in the simplified_api/capella.py
file with the code you provided, but I still get an empty list.
Hi @EAly
I used the following script on the IFE example and it works with the above patch:
# include needed for the Capella modeller API
include('workspace://Python4Capella/simplified_api/capella.py')
if False:
from simplified_api.capella import *
aird_path = '/In-Flight Entertainment System/In-Flight Entertainment System.aird'
model = CapellaModel()
model.open(aird_path)
diagrams = model.get_all_diagrams()
for diagram in diagrams:
print(diagram.get_name())
I'm using Capella 6.1.0 under Linux with Python 3.7.17. I can test with other version of Capella or Python if needed.
Hi @ylussaud ,
Thanks for your reply, I tried the script on the IFE example as well as on another project I'm working on and I get an empty list in both cases. I'm using Capella 6.10 under macOs 13.5.1 with python 3.11.4
Thanks again for your help
I tried with Python 3.11.5 and it works... Not sure what is going wrong here.
Thanks @ylussaud , it worked after I reloaded the Python4Capella project.
The Sirius module return a non empty list but the Python loop doesn't iterate over it. To fix this we can use the following code: