Get Project Path

A few years ago, Marc Pelletier helped me by writing a GX that grabbed the project location, wrote a .bat file that would set an environment variable which could be read from a .GS or a Python script. The solution won't work anymore and I'm wondering if anyone has a suggestion for how to get the Geosoft Project path to a GS, or Python Script. I was hoping that the new Python API would get me there, but I could use a hand pointing me in the right direction.

I suspect I'll need to dust off the books and re-figure out how to write a GX myself...

I was also wondering what issues I would run into if I stuck with Python 2.7 and still tried using Geosoft's Python API instead of installing Python 3.4 on all the users machines. Impossible?

Comments

  • ThomasStanleyJones
    edited August 2016
    Whew, finished. Thanks Geosoft for giving out the source code for the GXs. I modified WINEXEC.gxc to optionally pass the project filename as a command line argument. A couple things that I struggled with on the way that could be explained better in the documentation:
    • The method GetName_PROJ actually returns the filepath of the project, not just the name. It was the only one I found that seemed like it would work, but I wasn't sure until I finally got the GX to run.
    • I didn't notice anything in the Help documentation about needing a geosettings.meta file alongside the GXC file for it to compile. Luckily Ian MacLeod's python.gx upload had one included.
    Otherwise, thanks for organizing the development side of things as well as it is.
  • Hi Thomas,

    Let us know if there's anything else we can help you with.

    Joseph
This discussion has been closed.