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

[New Feature] Load AequilibraE project on qgis project opening #186

Closed
Art-Ev opened this issue Apr 28, 2022 · 4 comments · Fixed by #314
Closed

[New Feature] Load AequilibraE project on qgis project opening #186

Art-Ev opened this issue Apr 28, 2022 · 4 comments · Fixed by #314
Assignees

Comments

@Art-Ev
Copy link
Contributor

Art-Ev commented Apr 28, 2022

Now that AequilibraE projects are based on a folder:
QGIS projects can store some python macros (project -> properties -> Macros) to launch for example when opening a qgis project (macro store in qgz file).
We could create a script to load AequilibraE project for the folder in which qgis project is stored (QgsProject.instance().absolutePath())

This way we could store a qgz file in AequilibraE folder and qgis will load AequilibraE project by itself when opening qgz file!

I've tried to create this by inspiring myself with load_project_action.py but cannot achieve it due to the qgis_project parameter that I don't fully understand, can somebody give me a hint ?

@pedrocamargo
Copy link
Contributor

Do you want to start a pull request for me to give you a hand on this?

@Art-Ev
Copy link
Contributor Author

Art-Ev commented May 11, 2022

If the code is within a qgz project I don't know if a PR is relevant, current file with an aequilibrae project : St_Varent.zip
To access code :

  • Open StVarent_model.qgz
  • Go to qgis project menu (the one in the upper left corner) -> "Properties" -> "Macros"

For now I don't understand how to link to EquilibraEMenu, maybe you have some ideas ?

Another solution could be to integrate a test when AequilibraE is loading (maybe directly in AequilibraEMenu.py ?) and if qgis project is stored in a relevant folder, load the projet. The issue is that QGIS is starting all plugins and, only after, load the project (but perhaps the path of the project is already accessible during plugins initialisation)

@pedrocamargo
Copy link
Contributor

I am not sure this is possible, but @r-akemii will take a look at it

@pedrocamargo
Copy link
Contributor

pedrocamargo commented Mar 11, 2024

@r-akemii , there are tips on how to do this here: pedrocamargo/getthemfiltered#13

@r-akemii r-akemii linked a pull request Apr 2, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants