Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property Value type stops the API from working #232

Open
kortvelyin opened this issue Sep 30, 2024 · 1 comment
Open

Property Value type stops the API from working #232

kortvelyin opened this issue Sep 30, 2024 · 1 comment

Comments

@kortvelyin
Copy link

When in the "workspace://Python4Capella/sample_scripts/Export_Property_Values_associated_to_elements_to_xlsx.py" script I write "Class" as the type, (I wanted to get the CBD diagram parts,) Capella starts to give the "ModuleNotFoundError: No module named 'simplified_api'" error. From then on, whatever I run, however I rename or re-import the simplified_api folder, same error. I tried to restart Capella, refresh, nothing. Only solution I found is to delete the Python4capella project from capella and then re-import it.

@ylussaud
Copy link
Contributor

ylussaud commented Oct 1, 2024

PyDev automatically import some used modules the Python way. Check that you use:

# include needed for the Capella modeller API
include('workspace://Python4Capella/simplified_api/capella.py')
if False:
    from simplified_api.capella import *

and not just:

from simplified_api.capella import *

or

import simplified_api.capella

EASY need to copy everything imported using include() in the main module to work. At least as far as I understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants