AequilibraE / qaequilibrae

Free QGIS add-on for transportation modeling
https://www.aequilibrae.com/qgis/latest/
Other
75 stars 24 forks source link

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

Closed Art-Ev closed 7 months ago

Art-Ev commented 2 years ago

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 commented 2 years ago

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

Art-Ev commented 2 years ago

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 :

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 commented 1 year ago

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

pedrocamargo commented 8 months ago

@r-akemii , there are tips on how to do this here: https://github.com/pedrocamargo/getthemfiltered/pull/13